Panel Interface Board  1
inszt_switches.c
Go to the documentation of this file.
1 /*
2 C TESTBED VERSION : 9.7.2
3 FILE UNDER TEST : "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\switches.c"
4 DATE OF ANALYSIS : Thu Aug 27 13:27:14 2020
5 */
6 /**************************************************************************************/
23 /**************************************************************************************/
24 /**************************************************************************************/
25 /**************************************************************************************/
26 /* Section: Included Files */
27 /**************************************************************************************/
28 /**************************************************************************************/
29 /* This section lists the other files that are included in this file.
30  */
31 #define QQQdialect MPLABX
32 #undef QQQ146
33 #undef QQQ148
34 #undef QQQbndchk
35 #undef QQQ294
36 #undef QQQEMBEDDEDICE
37  /* Note: for BITMAP execution histories QQQthreaded is not defined */
38 #undef QQQthreaded
39 #undef QQQdo178b
40 #undef QQQfixbra
41 #define QQQswitch3
42 #undef QQQternary
43 #define QQQswitch
44 #undef QQQmacrof
45 #undef QQQMULTIPROCESSEXH
46 #undef QQFLUSH
47 #undef QQNEWBS
48 #define qqqMaxBranchDepth 20
49 #define QQQstructbitmap
50  static int qqqqbmselwidth = 32 ;
51  static int zzfileid = 57;
52 #define QQQnumfil 23
53 #undef QQQALGONE
54 #undef QQQVCLFLG
55 #undef QQQFORKFL
56 #undef QQQIADDRF
57 #undef QQQRTI
58 #undef QQQPERFA
59 #undef QQQADRMOD
60 #undef QQQDCAPFL
61 #undef QQQTEMPLATEONLY
62 #define QQQNOATEXIT
63 #define QQQUPLOADATEND
64 #define QQQNOSTDIO
65 #undef QQQASHLINGVITRA
66 #define QQQBITMAP
67  #define qqqbitmapint unsigned int
68 #undef QQQBITMAPMCDC
69 #undef QQQTIC2XSERIALIO
70 #undef QQQTIC2XFLASH
71 #undef QQQCOMPRESSED_EXH
72 #undef QQQMAINFL
73 #define QQQSINGLEFILE
74 #define QQQFILEID
75 #define QQQseparate
76 extern int QQQindicator;
77 static int QQQfirstmcdc=1;
78 #define switches_57zzopen zzopen
79  extern int switches_57zzopen ;
80 #define switches_57zqqzqz1 zqqzqz1
81 #define QQQLDRA_PORT
82 #ifndef QQQLDRA_PORT
83 #define FILEPOINT FILE * f,
84 #if !defined(QQQTEMPLATEONLY) && !defined(FILE) && !defined(QQQNOSTDIO)
85 #include <stdio.h>
86  /* ----------------------------------------------------------------------* 100 *
87  * If stdio.h is not available then insert:
88  * typedef int * FILE;
89  * -----------------------------------------------------------------------------
90  */
91 #endif /* !(QQQTEMPLATEONLY) && !(FILE) && !(QQQNOSTDIO) */
92 #else /* QQQLDRA_PORT */
93 #define FILEPOINT
94 /*************************** LDRA_PORT *********************************/
95 #ifdef QQQ_SHLAYOUT
96 static int tbrun_mode=1;
97 #else
98 static int tbrun_mode=0;
99 #endif /* QQQ_SHLAYOUT */
100 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.h"
101 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.h"
102 #ifndef QQQ_SHLAYOUT
103 #ifdef QQQMAINFL
104 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.c"
105 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.c"
106 #endif /* QQQMAINFL */
107 #endif /* QQQ_SHLAYOUT */
108 /************************ END OF LDRA_PORT *****************************/
109 #endif /* QQQLDRA_PORT */
110 #ifndef QQQnumfil
111 #define QQQnumfil 40 /* default setting */
112 #endif /* QQQnumfil */
113 #if defined(QQQstructbitmap) && defined(QQQSINGLEFILE)
114 #ifndef LDRA_VOID_FUNC
115 #define LDRA_VOID_FUNC
116  typedef void(*ldra_void_function)();
117 #endif
118 #if defined(QQQMAINFL)
119  /* Set qqqshell_upload to 1 if you want to call the qqqtotalupload separately. Although
120  through the target you would have to set this to 0 before calling the qqqupload.
121  Move this into ldra_port mechanism. */
122  int qqqshell_upload = 0;
123  int QQQfcn_ptr_num = 0;
124  static int qqqisinitialised = 0;
127  void qqqtotalupload(void);
128  void qqqtotalreset(void);
130  qqqaccumupload[x]=y;
131  qqqaccumreset[x]=z;
132  QQQfcn_ptr_num++;
133  }
134 #else /* (QQQMAINFL) */
135  extern int QQQfcn_ptr_num;
138  static int qqqstructzzopen = 0;
139 #endif /* defined(QQQMAINFL) */
140 #endif /* defined(QQQstructbitmap) && defined(QQQSINGLEFILE) */
141 #ifdef QQQ_KEEPCOMMENTS
142  /* -----------------------------------------------------------------------* 101 *
143  * Special settings for systems lacking standard functions.
144  * To include code for fprintf define ldra_fprintf
145  * To include code for sscanf define ldra_sscanf
146  * -----------------------------------------------------------------------------
147  */
148 #endif /* QQQ_KEEPCOMMENTS */
149 #if !defined(QQQSUPPRESS_UNDEF)
150 #undef ldra_fprintf
151 #undef ldra_sscanf
152 #endif /* !defined(QQQSUPPRESS_UNDEF) */
153  /* #define ldra_fprintf */
154  /* #define ldra_sscanf */
155 #undef QQQHITMAP_STORAGE
156 #undef qqnull_params
157 #define qqnull_params void
158 #define QQQ_PROTOTYPE_DEF
159  /* Conventional Instrumentation */
160 #undef QQ_ANSI_PROTOTYPE
161 #ifdef __STDC__
162 #define QQ_ANSI_PROTOTYPE 1
163 #else /* __STDC__ */
164 #ifdef VAXC
165 #define QQ_ANSI_PROTOTYPE 1
166 #endif /* VAXC */
167 #endif /* __STDC__ */
168  static unsigned char qqqzzglobflag = 0;
169  static struct bitmapstruct_t
170  {
171 #define ELEMENT(N) qqqbitmapint element##N;
172 #define LASTELEMENT
173 #include "switches_57zbelem.def"
174 #undef ELEMENT
175 #undef LASTELEMENT
176  } bitmapstruct = {
177 #define ELEMENT(N) 0,
178 #undef LASTELEMENT
179 #include "switches_57zbelem.def"
180 #undef ELEMENT
181  0};
182  static void qqoutput(FILEPOINT char * s,int i);
183  static void qqoutput2(FILEPOINT char * s,int i, int j);
184  static void qqoutput3(FILEPOINT char * s,int i,int j,int k);
185  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l);
186  static void qqoutput0(FILEPOINT char * s);
187  static int switches_57zqqzqz(qqnull_params);
188  static int switches_57zqqzqz1(qqnull_params);
189  static int switches_57zqendz (int qqqi);
190  static int switches_57zqzqzq (int qqqi);
191  static void qqqupload(qqnull_params);
192  static void qqqbitmapreset(qqnull_params);
193 /* ------------------------------ END OF TESTBED PROTOTYPES -------------------------------- */
194 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\switches.h */
195 /**************************************************************************************/
211 /**************************************************************************************/
212 #ifndef SWITCHES_H /* Guard against multiple inclusion.*/
213 #define SWITCHES_H
214 /**************************************************************************************/
215 /**************************************************************************************/
216 /* Section: Included Files */
217 /**************************************************************************************/
218 /**************************************************************************************/
219 #include <stdint.h>
220 #include <stdbool.h>
221 /**************************************************************************************/
222 /**************************************************************************************/
223 /* Section: Defines */
224 /**************************************************************************************/
225 /**************************************************************************************/
226 #define S3_NUM_OF_POSITIONS 5U
227 #define S6_NUM_OF_POSITIONS 3U
228 #define S4_NUM_OF_POSITIONS 2U
229 #define S1_NUM_OF_POSITIONS 2U
230 /**************************************************************************************/
231 /**************************************************************************************/
232 /* Section: Data Types */
233 /**************************************************************************************/
234 /**************************************************************************************/
235 /**************************************************************************************/
236 /* SWITCH states
237  Summary:
238  SWITCH states enumeration
239  Description:
240  This enumeration defines the valid SWITCH states. These states
241  determine the behavior of the SWITCH state machine at various times.
242 */
243 
244 typedef
245  enum
246  {
253  } SWITCH_STATES ;
254 /**************************************************************************************/
255 /* SWITCH_DATA
256  Summary:
257  Holds SWITCH_DATA used for the SWITCH tasks.
258  Description:
259  Holds SWITCH_DATA used for the SWITCH tasks. The state machine and variables
260  used to control SWITCH functions are stored here.
261  Remarks:
262  None
263  */
264 
265 typedef
266  struct
267  {
268  SWITCH_STATES state ;
269  uint8_t knob_switch_S3 [ 5 ] ;
270  uint8_t key_switch_S6 [ 3 ] ;
271  uint8_t pol_switch_S4 [ 2 ] ;
272  uint8_t dump_fire_switch_S7 ;
273  uint8_t fire_switch_S1 [ 2 ] ;
274  uint8_t hvps_switch_S5 ;
275  bool S3_flag ;
276  bool S6_flag ;
277  bool S4_flag ;
278  bool S1_flag ;
279  uint16_t store_buffer [ 2 ] ;
280  uint16_t settings ;
281  uint8_t dump_fire_count ;
282  bool debounce_flag ;
283  bool debounce_tick ;
284  uint8_t read_try ;
285  } SWITCH_DATA ;
286 
287 extern SWITCH_DATA
288  SWITCH ;
289 /**************************************************************************************/
290 /* S3_COMMAND
291  Summary:
292  S3_COMMAND enumeration
293  Description:
294  This enumeration defines the valid S3_COMMAND results. These states
295  determine the behavior of the SWITCH state machine at various times.
296 */
297 
298 typedef
299  enum
300  {
306  } S3_COMMAND ;
307 /**************************************************************************************/
308 /* S4_COMMAND
309  Summary:
310  S4_COMMAND enumeration
311  Description:
312  This enumeration defines the valid S4_COMMAND results. These states
313  determine the behavior of the SWITCH state machine at various times.
314 */
315 
316 typedef
317  enum
318  {
321  } S4_COMMAND ;
322 /**************************************************************************************/
323 /* S7_COMMAND
324  Summary:
325  S7_COMMAND enumeration
326  Description:
327  This enumeration defines the valid S7_COMMAND results. These states
328  determine the behavior of the S7_SWITCH state machine at various times.
329 */
330 
331 typedef
332  enum
333  {
337  } S7_COMMAND ;
338 /**************************************************************************************/
339 /* S1_COMMAND
340  Summary:
341  S1_COMMAND enumeration
342  Description:
343  This enumeration defines the valid S1_COMMAND results. These states
344  determine the behavior of the SWITCH state machine at various times.
345 */
346 
347 typedef
348  enum
349  {
352  } S1_COMMAND ;
353 /**************************************************************************************/
354 /* S5_COMMAND
355  Summary:
356  S5_COMMAND enumeration
357  Description:
358  This enumeration defines the valid S5_COMMAND results. These states
359  determine the behavior of the S5_SWITCH state machine at various times.
360 */
361 
362 typedef
363  enum
364  {
367  } S5_COMMAND ;
368 /**************************************************************************************/
369 /* SWITCH_COMMAND
370  Summary:
371  Holds SWITCH_COMMAND data used for the SWITCH tasks.
372  Description:
373  Holds SWITCH_COMMAND data used for the SWITCH tasks. The state machine and variables
374  used to control SWITCH_COMMAND functions are stored here.
375  Remarks:
376  None
377  */
378 
379 typedef
380  struct
381  {
382  S3_COMMAND S3_state ;
383  S4_COMMAND S4_state ;
384  S7_COMMAND S7_state ;
385  S1_COMMAND S1_state ;
386  S5_COMMAND S5_state ;
387  bool dmpfire_flag ;
388  bool dmpled_tick ;
389  } SWITCH_COMMAND ;
390 
391 extern SWITCH_COMMAND
392  SW_COM ;
393 /**************************************************************************************/
394 /**************************************************************************************/
395 /* Section: Local Functions */
396 /**************************************************************************************/
397 /**************************************************************************************/
398 /*!*************************************************************************************
399  Function:
400  static void read_switches(void)
401  Summary:
402  This function determines all of the switch positions.
403  Description:
404  This function determines all of the switch positions. It does this by
405  monitoring all of a given switches lines and ensuring that only one line per
406  switch is active. For switches with multiple positions, each position is put
407  into an array. Only one location in a given array can be active or true.
408  The switch locations are then passed on to be processed and
409  converted into commands to actuate relays or other activity.
410 
411  Precondition:
412  None.
413  Parameters:
414  None.
415  Returns
416  None.
417 
418  Remarks:
419  None.
420 
421  Example:
422  read_switches()
423  */
424 
425 static void
426  read_switches ( void ) ;
427 /*!*************************************************************************************
428  Function:
429  static void process_switches(void)
430  Summary:
431  This function converts the front panel switch positions into commands.
432  Description:
433  This function converts the front panel switch positions into commands. It does
434  this by converting a switch active array location into a command that can be
435  executed. The commands from a switch are held as state machines.
436 
437  Precondition:
438  None.
439  Parameters:
440  None.
441  Returns
442  None.
443 
444  Remarks:
445  None.
446 
447  Example:
448  process_switches()
449  */
450 
451 static void
452  process_switches ( void ) ;
453 /*!*************************************************************************************
454  Function:
455  static void execute_switches(void)
456  Summary:
457  This function actuates relays based on the front panel switch position.
458  Description:
459  This function actuates relays based on the front panel switch position.
460 
461  Precondition:
462  None.
463  Parameters:
464  None.
465  Returns
466  None.
467 
468  Remarks:
469  None.
470 
471  Example:
472  static void execute_switches()
473  */
474 
475 static void
476  execute_switches ( void ) ;
477 /*!*************************************************************************************
478  Function:
479  static void store_switches(void)
480  Summary:
481  This function stores the switch positions to be transferred to the host.
482  Description:
483  This function stores the switch positions to be transferred to the host. The
484  switch positions are transferred into two 8-bit array locations. This data can
485  then be sent to the host when requested. No other actions occur with this data.
486 
487  Precondition:
488  None.
489  Parameters:
490  None.
491  Returns
492  None.
493 
494  Remarks:
495  None.
496 
497  Example:
498  store_switches()
499  */
500 
501 static void
502  store_switches ( void ) ;
503 /**************************************************************************************/
504 /**************************************************************************************/
505 /* State Machine Functions */
506 /**************************************************************************************/
507 /**************************************************************************************/
508 /*!*************************************************************************************
509  Function:
510  void SWITCH_Tasks ( void )
511  Summary:
512  SWITCH_Tasks function
513  Description:
514  This routine is the SWITCH_Tasks function. It defines the SWITCH_Tasks state
515  machine and core logic. This machine is used to monitor the front panel switches
516  and perform the tasks as designated by the switches.
517  Precondition:
518  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
519  should be called before calling this.
520  Parameters:
521  None.
522  Returns:
523  None.
524  Remarks:
525  This routine must be called from the APP_Tasks() routine.
526  Example:
527  SWITCH_Task()
528  */
529 
530 void
531  SWITCH_Tasks ( void ) ;
532  /* SWITCHES_H */
533 /***************************************************************************************
534  End of File
535  */
536 
537 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\switches.h*/
538 /* CLOSE_FILE Include File */
539 
540 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\hvps.h */
541 //**************************************************************************************/
555 /**************************************************************************************/
556 #ifndef HVPS_H /* Guard against multiple inclusion.*/
557 #define HVPS_H
558 /**************************************************************************************/
559 /**************************************************************************************/
560 /* Section: Included Files */
561 /**************************************************************************************/
562 /**************************************************************************************/
563 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h */
564 /*******************************************************************************
565  System Definitions
566  File Name:
567  system_definitions.h
568  Summary:
569  MPLAB Harmony project system definitions.
570  Description:
571  This file contains the system-wide prototypes and definitions for an MPLAB
572  Harmony project.
573  *******************************************************************************/
574 //DOM-IGNORE-BEGIN
575 /*******************************************************************************
576 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
577 Microchip licenses to you the right to use, modify, copy and distribute
578 Software only when embedded on a Microchip microcontroller or digital signal
579 controller that is integrated into your product or third party product
580 (pursuant to the sublicense terms in the accompanying license agreement).
581 You should refer to the license agreement accompanying this Software for
582 additional information regarding your rights and obligations.
583 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
584 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
585 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
586 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
587 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
588 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
589 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
590 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
591 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
592 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
593  *******************************************************************************/
594 //DOM-IGNORE-END
595 #ifndef _SYS_DEFINITIONS_H
596 #define _SYS_DEFINITIONS_H
597 // *****************************************************************************
598 // *****************************************************************************
599 // Section: Included Files
600 // *****************************************************************************
601 // *****************************************************************************
602 #include <stdint.h>
603 #include <stddef.h>
604 #include <stdbool.h>
605 #include "system/common/sys_common.h"
606 #include "system/common/sys_module.h"
607 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h */
608 /*******************************************************************************
609  Input Capture Driver Interface Declarations for Static Single Instance Driver
610  Company:
611  Microchip Technology Inc.
612  File Name:
613  help_drv_ic.h
614  Summary:
615  Input Capture driver interface declarations for the static single instance
616  driver.
617  Description:
618  The Input Capture device driver provides a simple interface to manage the
619  Input Capture modules on Microchip microcontrollers. This file defines
620  the interface declarations for the IC driver.
621 
622  Remarks:
623  Static interfaces incorporate the driver instance number within the names
624  of the routines, eliminating the need for an object ID or object handle.
625 
626  Static single-open interfaces also eliminate the need for the open handle.
627 *******************************************************************************/
628 //DOM-IGNORE-BEGIN
629 /*******************************************************************************
630 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
631 Microchip licenses to you the right to use, modify, copy and distribute
632 Software only when embedded on a Microchip microcontroller or digital signal
633 controller that is integrated into your product or third party product
634 (pursuant to the sublicense terms in the accompanying license agreement).
635 You should refer to the license agreement accompanying this Software for
636 additional information regarding your rights and obligations.
637 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
638 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
639 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
640 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
641 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
642 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
643 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
644 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
645 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
646 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
647 *******************************************************************************/
648 //DOM-IGNORE-END
649 #ifndef _DRV_IC_H
650 #define _DRV_IC_H
651 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h */
652 /*******************************************************************************
653  MPLAB Harmony System Configuration Header
654  File Name:
655  system_config.h
656  Summary:
657  Build-time configuration header for the system defined by this MPLAB Harmony
658  project.
659  Description:
660  An MPLAB Project may have multiple configurations. This file defines the
661  build-time options for a single configuration.
662  Remarks:
663  This configuration header must not define any prototypes or data
664  definitions (or include any files that do). It only provides macro
665  definitions for build-time configuration options that are not instantiated
666  until used by another MPLAB Harmony module or application.
667  Created with MPLAB Harmony Version 2.06
668 *******************************************************************************/
669 // DOM-IGNORE-BEGIN
670 /*******************************************************************************
671 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
672 Microchip licenses to you the right to use, modify, copy and distribute
673 Software only when embedded on a Microchip microcontroller or digital signal
674 controller that is integrated into your product or third party product
675 (pursuant to the sublicense terms in the accompanying license agreement).
676 You should refer to the license agreement accompanying this Software for
677 additional information regarding your rights and obligations.
678 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
679 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
680 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
681 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
682 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
683 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
684 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
685 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
686 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
687 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
688 *******************************************************************************/
689 // DOM-IGNORE-END
690 #ifndef _SYSTEM_CONFIG_H
691 #define _SYSTEM_CONFIG_H
692 // *****************************************************************************
693 // *****************************************************************************
694 // Section: Included Files
695 // *****************************************************************************
696 // *****************************************************************************
697 /* This section Includes other configuration headers necessary to completely
698  define this configuration.
699 */
700 // DOM-IGNORE-BEGIN
701 // DOM-IGNORE-END
702 // *****************************************************************************
703 // *****************************************************************************
704 // Section: System Service Configuration
705 // *****************************************************************************
706 // *****************************************************************************
707 // *****************************************************************************
708 /* Common System Service Configuration Options
709 */
710 #define SYS_VERSION_STR "2.06"
711 #define SYS_VERSION 20600
712 // *****************************************************************************
713 /* Clock System Service Configuration Options
714 */
715 #define SYS_CLK_FREQ 200000000ul
716 #define SYS_CLK_BUS_PERIPHERAL_1 100000000ul
717 #define SYS_CLK_BUS_PERIPHERAL_2 100000000ul
718 #define SYS_CLK_BUS_PERIPHERAL_3 100000000ul
719 #define SYS_CLK_BUS_PERIPHERAL_4 100000000ul
720 #define SYS_CLK_BUS_PERIPHERAL_5 100000000ul
721 #define SYS_CLK_BUS_PERIPHERAL_7 200000000ul
722 #define SYS_CLK_BUS_PERIPHERAL_8 100000000ul
723 #define SYS_CLK_CONFIG_PRIMARY_XTAL 0ul
724 #define SYS_CLK_CONFIG_SECONDARY_XTAL 32768ul
725 /*** Ports System Service Configuration ***/
726 #define SYS_PORT_A_ANSEL 0x3F00
727 #define SYS_PORT_A_TRIS 0xFFED
728 #define SYS_PORT_A_LAT 0x0010
729 #define SYS_PORT_A_ODC 0x0000
730 #define SYS_PORT_A_CNPU 0x0020
731 #define SYS_PORT_A_CNPD 0x0000
732 #define SYS_PORT_A_CNEN 0x0021
733 #define SYS_PORT_B_ANSEL 0x10C8
734 #define SYS_PORT_B_TRIS 0x91FF
735 #define SYS_PORT_B_LAT 0x0000
736 #define SYS_PORT_B_ODC 0x0000
737 #define SYS_PORT_B_CNPU 0x0000
738 #define SYS_PORT_B_CNPD 0x0000
739 #define SYS_PORT_B_CNEN 0x0000
740 #define SYS_PORT_C_ANSEL 0xCFE1
741 #define SYS_PORT_C_TRIS 0xFFFF
742 #define SYS_PORT_C_LAT 0x0000
743 #define SYS_PORT_C_ODC 0x0000
744 #define SYS_PORT_C_CNPU 0x0000
745 #define SYS_PORT_C_CNPD 0x0000
746 #define SYS_PORT_C_CNEN 0x0000
747 #define SYS_PORT_D_ANSEL 0xC100
748 #define SYS_PORT_D_TRIS 0xFFFF
749 #define SYS_PORT_D_LAT 0x0000
750 #define SYS_PORT_D_ODC 0x0000
751 #define SYS_PORT_D_CNPU 0x0000
752 #define SYS_PORT_D_CNPD 0x0000
753 #define SYS_PORT_D_CNEN 0x0000
754 #define SYS_PORT_E_ANSEL 0xFC00
755 #define SYS_PORT_E_TRIS 0xFDFF
756 #define SYS_PORT_E_LAT 0x0000
757 #define SYS_PORT_E_ODC 0x0000
758 #define SYS_PORT_E_CNPU 0x0000
759 #define SYS_PORT_E_CNPD 0x0000
760 #define SYS_PORT_E_CNEN 0x0000
761 #define SYS_PORT_F_ANSEL 0xCEC0
762 #define SYS_PORT_F_TRIS 0xEFFF
763 #define SYS_PORT_F_LAT 0x0000
764 #define SYS_PORT_F_ODC 0x0000
765 #define SYS_PORT_F_CNPU 0x0000
766 #define SYS_PORT_F_CNPD 0x0000
767 #define SYS_PORT_F_CNEN 0x0000
768 #define SYS_PORT_G_ANSEL 0x8CBC
769 #define SYS_PORT_G_TRIS 0xDFFF
770 #define SYS_PORT_G_LAT 0x0000
771 #define SYS_PORT_G_ODC 0x0000
772 #define SYS_PORT_G_CNPU 0x0000
773 #define SYS_PORT_G_CNPD 0x0000
774 #define SYS_PORT_G_CNEN 0x0000
775 #define SYS_PORT_H_ANSEL 0x0070
776 #define SYS_PORT_H_TRIS 0xB3FB
777 #define SYS_PORT_H_LAT 0x0000
778 #define SYS_PORT_H_ODC 0x0000
779 #define SYS_PORT_H_CNPU 0x0000
780 #define SYS_PORT_H_CNPD 0x0000
781 #define SYS_PORT_H_CNEN 0x0000
782 #define SYS_PORT_J_ANSEL 0x0000
783 #define SYS_PORT_J_TRIS 0x8B7F
784 #define SYS_PORT_J_LAT 0x0080
785 #define SYS_PORT_J_ODC 0x0000
786 #define SYS_PORT_J_CNPU 0x0000
787 #define SYS_PORT_J_CNPD 0x0000
788 #define SYS_PORT_J_CNEN 0x0800
789 #define SYS_PORT_K_ANSEL 0xFF00
790 #define SYS_PORT_K_TRIS 0xFFFF
791 #define SYS_PORT_K_LAT 0x0000
792 #define SYS_PORT_K_ODC 0x0000
793 #define SYS_PORT_K_CNPU 0x0000
794 #define SYS_PORT_K_CNPD 0x0000
795 #define SYS_PORT_K_CNEN 0x0000
796 /*** Interrupt System Service Configuration ***/
797 #define SYS_INT true
798 /*** Timer System Service Configuration ***/
799 #define SYS_TMR_POWER_STATE SYS_MODULE_POWER_RUN_FULL
800 #define SYS_TMR_DRIVER_INDEX DRV_TMR_INDEX_0
801 #define SYS_TMR_MAX_CLIENT_OBJECTS 5
802 #define SYS_TMR_FREQUENCY 1000
803 #define SYS_TMR_FREQUENCY_TOLERANCE 10
804 #define SYS_TMR_UNIT_RESOLUTION 10000
805 #define SYS_TMR_CLIENT_TOLERANCE 10
806 #define SYS_TMR_INTERRUPT_NOTIFICATION false
807 // *****************************************************************************
808 // *****************************************************************************
809 // Section: Driver Configuration
810 // *****************************************************************************
811 // *****************************************************************************
812 #define DRV_IC_DRIVER_MODE_STATIC
813 #define USE_8BIT_PMP
814 /*** SPI Driver Configuration ***/
815 #define DRV_SPI_NUMBER_OF_MODULES 6
816 /*** Driver Compilation and static configuration options. ***/
817 /*** Select SPI compilation units.***/
818 #define DRV_SPI_POLLED 1
819 #define DRV_SPI_ISR 0
820 #define DRV_SPI_MASTER 1
821 #define DRV_SPI_SLAVE 0
822 #define DRV_SPI_RM 0
823 #define DRV_SPI_EBM 1
824 #define DRV_SPI_8BIT 1
825 #define DRV_SPI_16BIT 1
826 #define DRV_SPI_32BIT 0
827 #define DRV_SPI_DMA 0
828 /*** SPI Driver Static Allocation Options ***/
829 #define DRV_SPI_INSTANCES_NUMBER 3
830 #define DRV_SPI_CLIENTS_NUMBER 3
831 #define DRV_SPI_ELEMENTS_PER_QUEUE 10
832 /* SPI Driver Instance 0 Configuration */
833 #define DRV_SPI_SPI_ID_IDX0 SPI_ID_1
834 #define DRV_SPI_TASK_MODE_IDX0 DRV_SPI_TASK_MODE_POLLED
835 #define DRV_SPI_SPI_MODE_IDX0 DRV_SPI_MODE_MASTER
836 #define DRV_SPI_ALLOW_IDLE_RUN_IDX0 false
837 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX0 DRV_SPI_PROTOCOL_TYPE_FRAMED
838 #define DRV_SPI_FRAME_SYNC_PULSE_IDX0 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
839 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX0 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
840 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX0 SPI_FRAME_PULSE_DIRECTION_OUTPUT
841 #define DRV_SPI_FRAME_PULSE_EDGE_IDX0 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
842 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX0 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
843 #define DRV_SPI_COMM_WIDTH_IDX0 SPI_COMMUNICATION_WIDTH_16BITS
844 #define DRV_SPI_CLOCK_SOURCE_IDX0 SPI_BAUD_RATE_PBCLK_CLOCK
845 #define DRV_SPI_SPI_CLOCK_IDX0 CLK_BUS_PERIPHERAL_2
846 #define DRV_SPI_BAUD_RATE_IDX0 1000000
847 #define DRV_SPI_BUFFER_TYPE_IDX0 DRV_SPI_BUFFER_TYPE_ENHANCED
848 #define DRV_SPI_CLOCK_MODE_IDX0 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
849 #define DRV_SPI_INPUT_PHASE_IDX0 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
850 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX0 0xFFFF
851 #define DRV_SPI_QUEUE_SIZE_IDX0 10
852 #define DRV_SPI_RESERVED_JOB_IDX0 1
853 /* SPI Driver Instance 1 Configuration */
854 #define DRV_SPI_SPI_ID_IDX1 SPI_ID_2
855 #define DRV_SPI_TASK_MODE_IDX1 DRV_SPI_TASK_MODE_POLLED
856 #define DRV_SPI_SPI_MODE_IDX1 DRV_SPI_MODE_MASTER
857 #define DRV_SPI_ALLOW_IDLE_RUN_IDX1 false
858 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX1 DRV_SPI_PROTOCOL_TYPE_FRAMED
859 #define DRV_SPI_FRAME_SYNC_PULSE_IDX1 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
860 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX1 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
861 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX1 SPI_FRAME_PULSE_DIRECTION_OUTPUT
862 #define DRV_SPI_FRAME_PULSE_EDGE_IDX1 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
863 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX1 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
864 #define DRV_SPI_COMM_WIDTH_IDX1 SPI_COMMUNICATION_WIDTH_8BITS
865 #define DRV_SPI_CLOCK_SOURCE_IDX1 SPI_BAUD_RATE_PBCLK_CLOCK
866 #define DRV_SPI_SPI_CLOCK_IDX1 CLK_BUS_PERIPHERAL_2
867 #define DRV_SPI_BAUD_RATE_IDX1 1000000
868 #define DRV_SPI_BUFFER_TYPE_IDX1 DRV_SPI_BUFFER_TYPE_ENHANCED
869 #define DRV_SPI_CLOCK_MODE_IDX1 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
870 #define DRV_SPI_INPUT_PHASE_IDX1 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
871 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX1 0xFF
872 #define DRV_SPI_QUEUE_SIZE_IDX1 10
873 #define DRV_SPI_RESERVED_JOB_IDX1 1
874 /* SPI Driver Instance 2 Configuration */
875 #define DRV_SPI_SPI_ID_IDX2 SPI_ID_4
876 #define DRV_SPI_TASK_MODE_IDX2 DRV_SPI_TASK_MODE_POLLED
877 #define DRV_SPI_SPI_MODE_IDX2 DRV_SPI_MODE_MASTER
878 #define DRV_SPI_ALLOW_IDLE_RUN_IDX2 false
879 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX2 DRV_SPI_PROTOCOL_TYPE_FRAMED
880 #define DRV_SPI_FRAME_SYNC_PULSE_IDX2 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
881 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX2 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
882 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX2 SPI_FRAME_PULSE_DIRECTION_OUTPUT
883 #define DRV_SPI_FRAME_PULSE_EDGE_IDX2 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
884 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX2 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
885 #define DRV_SPI_COMM_WIDTH_IDX2 SPI_COMMUNICATION_WIDTH_16BITS
886 #define DRV_SPI_CLOCK_SOURCE_IDX2 SPI_BAUD_RATE_PBCLK_CLOCK
887 #define DRV_SPI_SPI_CLOCK_IDX2 CLK_BUS_PERIPHERAL_2
888 #define DRV_SPI_BAUD_RATE_IDX2 500000
889 #define DRV_SPI_BUFFER_TYPE_IDX2 DRV_SPI_BUFFER_TYPE_ENHANCED
890 #define DRV_SPI_CLOCK_MODE_IDX2 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
891 #define DRV_SPI_INPUT_PHASE_IDX2 SPI_INPUT_SAMPLING_PHASE_AT_END
892 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX2 0x0000
893 #define DRV_SPI_QUEUE_SIZE_IDX2 10
894 #define DRV_SPI_RESERVED_JOB_IDX2 1
895 /*** Timer Driver Configuration ***/
896 #define DRV_TMR_INTERRUPT_MODE true
897 /*** Timer Driver 0 Configuration ***/
898 #define DRV_TMR_PERIPHERAL_ID_IDX0 TMR_ID_2
899 #define DRV_TMR_INTERRUPT_SOURCE_IDX0 INT_SOURCE_TIMER_2
900 #define DRV_TMR_INTERRUPT_VECTOR_IDX0 INT_VECTOR_T2
901 #define DRV_TMR_ISR_VECTOR_IDX0 _TIMER_2_VECTOR
902 #define DRV_TMR_INTERRUPT_PRIORITY_IDX0 INT_PRIORITY_LEVEL4
903 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX0 INT_SUBPRIORITY_LEVEL0
904 #define DRV_TMR_CLOCK_SOURCE_IDX0 DRV_TMR_CLKSOURCE_INTERNAL
905 #define DRV_TMR_PRESCALE_IDX0 TMR_PRESCALE_VALUE_8
906 #define DRV_TMR_OPERATION_MODE_IDX0 DRV_TMR_OPERATION_MODE_16_BIT
907 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX0 false
908 #define DRV_TMR_POWER_STATE_IDX0
909 #define DRV_TMR_PERIPHERAL_ID_IDX1 TMR_ID_7
910 #define DRV_TMR_INTERRUPT_SOURCE_IDX1 INT_SOURCE_TIMER_7
911 #define DRV_TMR_INTERRUPT_VECTOR_IDX1 INT_VECTOR_T7
912 #define DRV_TMR_ISR_VECTOR_IDX1 _TIMER_7_VECTOR
913 #define DRV_TMR_INTERRUPT_PRIORITY_IDX1 INT_PRIORITY_LEVEL3
914 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX1 INT_SUBPRIORITY_LEVEL0
915 #define DRV_TMR_CLOCK_SOURCE_IDX1 DRV_TMR_CLKSOURCE_INTERNAL
916 #define DRV_TMR_PRESCALE_IDX1 TMR_PRESCALE_VALUE_16
917 #define DRV_TMR_OPERATION_MODE_IDX1 DRV_TMR_OPERATION_MODE_16_BIT
918 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX1 false
919 #define DRV_TMR_POWER_STATE_IDX1
920 /*** Timer Driver 2 Configuration ***/
921 #define DRV_TMR_PERIPHERAL_ID_IDX2 TMR_ID_6
922 #define DRV_TMR_INTERRUPT_SOURCE_IDX2 INT_SOURCE_TIMER_6
923 #define DRV_TMR_INTERRUPT_VECTOR_IDX2 INT_VECTOR_T6
924 #define DRV_TMR_ISR_VECTOR_IDX2 _TIMER_6_VECTOR
925 #define DRV_TMR_INTERRUPT_PRIORITY_IDX2 INT_PRIORITY_LEVEL1
926 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX2 INT_SUBPRIORITY_LEVEL0
927 #define DRV_TMR_CLOCK_SOURCE_IDX2 DRV_TMR_CLKSOURCE_INTERNAL
928 #define DRV_TMR_PRESCALE_IDX2 TMR_PRESCALE_VALUE_16
929 #define DRV_TMR_OPERATION_MODE_IDX2 DRV_TMR_OPERATION_MODE_16_BIT
930 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX2 false
931 #define DRV_TMR_POWER_STATE_IDX2
932 /*** Timer Driver 3 Configuration ***/
933 #define DRV_TMR_PERIPHERAL_ID_IDX3 TMR_ID_1
934 #define DRV_TMR_INTERRUPT_SOURCE_IDX3 INT_SOURCE_TIMER_1
935 #define DRV_TMR_INTERRUPT_VECTOR_IDX3 INT_VECTOR_T1
936 #define DRV_TMR_ISR_VECTOR_IDX3 _TIMER_1_VECTOR
937 #define DRV_TMR_INTERRUPT_PRIORITY_IDX3 INT_PRIORITY_LEVEL2
938 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX3 INT_SUBPRIORITY_LEVEL0
939 #define DRV_TMR_CLOCK_SOURCE_IDX3 DRV_TMR_CLKSOURCE_INTERNAL
940 #define DRV_TMR_PRESCALE_IDX3 TMR_PRESCALE_VALUE_256
941 #define DRV_TMR_OPERATION_MODE_IDX3 DRV_TMR_OPERATION_MODE_16_BIT
942 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX3 false
943 #define DRV_TMR_POWER_STATE_IDX3
944 /*** Timer Driver 4 Configuration ***/
945 #define DRV_TMR_PERIPHERAL_ID_IDX4 TMR_ID_3
946 #define DRV_TMR_INTERRUPT_SOURCE_IDX4 INT_SOURCE_TIMER_3
947 #define DRV_TMR_INTERRUPT_VECTOR_IDX4 INT_VECTOR_T3
948 #define DRV_TMR_ISR_VECTOR_IDX4 _TIMER_3_VECTOR
949 #define DRV_TMR_INTERRUPT_PRIORITY_IDX4 INT_PRIORITY_LEVEL1
950 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX4 INT_SUBPRIORITY_LEVEL0
951 #define DRV_TMR_CLOCK_SOURCE_IDX4 DRV_TMR_CLKSOURCE_INTERNAL
952 #define DRV_TMR_PRESCALE_IDX4 TMR_PRESCALE_VALUE_16
953 #define DRV_TMR_OPERATION_MODE_IDX4 DRV_TMR_OPERATION_MODE_16_BIT
954 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX4 false
955 #define DRV_TMR_POWER_STATE_IDX4
956  // *****************************************************************************
957 /* USART Driver Configuration Options
958 */
959 #define DRV_USART_INSTANCES_NUMBER 1
960 #define DRV_USART_CLIENTS_NUMBER 1
961 #define DRV_USART_INTERRUPT_MODE false
962 #define DRV_USART_BYTE_MODEL_SUPPORT true
963 #define DRV_USART_READ_WRITE_MODEL_SUPPORT false
964 #define DRV_USART_BUFFER_QUEUE_SUPPORT false
965 // *****************************************************************************
966 // *****************************************************************************
967 // Section: Middleware & Other Library Configuration
968 // *****************************************************************************
969 // *****************************************************************************
970 /*** USB Driver Configuration ***/
971 /* Enables Device Support */
972 #define DRV_USBHS_DEVICE_SUPPORT true
973 /* Disable Host Support */
974 #define DRV_USBHS_HOST_SUPPORT false
975 /* Maximum USB driver instances */
976 #define DRV_USBHS_INSTANCES_NUMBER 1
977 /* Interrupt mode enabled */
978 #define DRV_USBHS_INTERRUPT_MODE true
979 /* Number of Endpoints used */
980 #define DRV_USBHS_ENDPOINTS_NUMBER 2
981 /*** USB Device Stack Configuration ***/
982 /* The USB Device Layer will not initialize the USB Driver */
983 #define USB_DEVICE_DRIVER_INITIALIZE_EXPLICIT
984 /* Maximum device layer instances */
985 #define USB_DEVICE_INSTANCES_NUMBER 1
986 /* EP0 size in bytes */
987 #define USB_DEVICE_EP0_BUFFER_SIZE 64
988 /* Endpoint Transfer Queue Size combined for Read and write */
989 #define USB_DEVICE_ENDPOINT_QUEUE_DEPTH_COMBINED 2
990 // *****************************************************************************
991 // *****************************************************************************
992 // Section: Application Configuration
993 // *****************************************************************************
994 // *****************************************************************************
995 /*** Application Defined Pins ***/
996 /*** Functions for LED1 pin ***/
997 #define LED1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
998 #define LED1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
999 #define LED1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
1000 #define LED1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
1001 #define LED1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 , Value )
1002 /*** Functions for LED2 pin ***/
1003 #define LED2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
1004 #define LED2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
1005 #define LED2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
1006 #define LED2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
1007 #define LED2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 , Value )
1008 /*** Functions for DMP_FIRE_LED pin ***/
1009 #define DMP_FIRE_LEDToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
1010 #define DMP_FIRE_LEDOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
1011 #define DMP_FIRE_LEDOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
1012 #define DMP_FIRE_LEDStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
1013 #define DMP_FIRE_LEDStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 , Value )
1014 /*** Functions for HVPS_ENB pin ***/
1015 #define HVPS_ENBToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
1016 #define HVPS_ENBOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
1017 #define HVPS_ENBOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
1018 #define HVPS_ENBStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
1019 #define HVPS_ENBStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 , Value )
1020 /*** Functions for RLY_HVPS_OUT pin ***/
1021 #define RLY_HVPS_OUTToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
1022 #define RLY_HVPS_OUTOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
1023 #define RLY_HVPS_OUTOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
1024 #define RLY_HVPS_OUTStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
1025 #define RLY_HVPS_OUTStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 , Value )
1026 /*** Functions for RLY_WL_SPS_POL pin ***/
1027 #define RLY_WL_SPS_POLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
1028 #define RLY_WL_SPS_POLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
1029 #define RLY_WL_SPS_POLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
1030 #define RLY_WL_SPS_POLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
1031 #define RLY_WL_SPS_POLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 , Value )
1032 /*** Functions for RLY_LOG pin ***/
1033 #define RLY_LOGToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
1034 #define RLY_LOGOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
1035 #define RLY_LOGOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
1036 #define RLY_LOGStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
1037 #define RLY_LOGStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 , Value )
1038 /*** Functions for RLY_DMP_FIRE pin ***/
1039 #define RLY_DMP_FIREToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
1040 #define RLY_DMP_FIREOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
1041 #define RLY_DMP_FIREOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
1042 #define RLY_DMP_FIREStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
1043 #define RLY_DMP_FIREStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 , Value )
1044 /*** Functions for RLY_AUX pin ***/
1045 #define RLY_AUXToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
1046 #define RLY_AUXOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
1047 #define RLY_AUXOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
1048 #define RLY_AUXStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
1049 #define RLY_AUXStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 , Value )
1050 /*** Functions for RLY_CCL pin ***/
1051 #define RLY_CCLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
1052 #define RLY_CCLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
1053 #define RLY_CCLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
1054 #define RLY_CCLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
1055 #define RLY_CCLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 , Value )
1056 /*** Functions for RLY_WL_MON pin ***/
1057 #define RLY_WL_MONToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
1058 #define RLY_WL_MONOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
1059 #define RLY_WL_MONOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
1060 #define RLY_WL_MONStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
1061 #define RLY_WL_MONStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 , Value )
1062 /*** Functions for RLY_ARMCF pin ***/
1063 #define RLY_ARMCFToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
1064 #define RLY_ARMCFOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
1065 #define RLY_ARMCFOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
1066 #define RLY_ARMCFStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
1067 #define RLY_ARMCFStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 , Value )
1068 /*** Functions for RLY_ARM pin ***/
1069 #define RLY_ARMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
1070 #define RLY_ARMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
1071 #define RLY_ARMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
1072 #define RLY_ARMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
1073 #define RLY_ARMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 , Value )
1074 /*** Functions for TPAN1 pin ***/
1075 #define TPAN1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
1076 #define TPAN1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
1077 #define TPAN1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
1078 #define TPAN1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
1079 #define TPAN1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 , Value )
1080 /*** Functions for TPAN2 pin ***/
1081 #define TPAN2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
1082 #define TPAN2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
1083 #define TPAN2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
1084 #define TPAN2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
1085 #define TPAN2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 , Value )
1086 /*** Functions for FSK_DAC_CS pin ***/
1087 #define FSK_DAC_CSToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
1088 #define FSK_DAC_CSOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
1089 #define FSK_DAC_CSOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
1090 #define FSK_DAC_CSStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
1091 #define FSK_DAC_CSStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 , Value )
1092 /*** Functions for RLY_COMM pin ***/
1093 #define RLY_COMMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
1094 #define RLY_COMMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
1095 #define RLY_COMMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
1096 #define RLY_COMMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
1097 #define RLY_COMMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 , Value )
1098 /*** Functions for FSK_DAC_CLR pin ***/
1099 #define FSK_DAC_CLRToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
1100 #define FSK_DAC_CLROn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
1101 #define FSK_DAC_CLROff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
1102 #define FSK_DAC_CLRStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
1103 #define FSK_DAC_CLRStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 , Value )
1104 /*** Functions for WL_CPS_SW pin ***/
1105 #define WL_CPS_SWToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
1106 #define WL_CPS_SWOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
1107 #define WL_CPS_SWOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
1108 #define WL_CPS_SWStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
1109 #define WL_CPS_SWStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 , Value )
1110 /*** Functions for HVPS_SW pin ***/
1111 #define HVPS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_5 )
1112 /*** Functions for MAN_SIG pin ***/
1113 #define MAN_SIGStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_0 )
1114 /*** Functions for DMP_FIRE_SW pin ***/
1115 #define DMP_FIRE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_8 )
1116 /*** Functions for NEG_SW pin ***/
1117 #define NEG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_4 )
1118 /*** Functions for POS_SW pin ***/
1119 #define POS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_15 )
1120 /*** Functions for DRUM1_SW pin ***/
1121 #define DRUM1_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_2 )
1122 /*** Functions for SAFE_SW pin ***/
1123 #define SAFE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_1 )
1124 /*** Functions for DRUM2_SW pin ***/
1125 #define DRUM2_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_0 )
1126 /*** Functions for LOG_SW pin ***/
1127 #define LOG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_3 )
1128 /*** Functions for AUX_SW pin ***/
1129 #define AUX_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_8 )
1130 /*** Functions for ARMCF_SW pin ***/
1131 #define ARMCF_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_1 )
1132 /*** Functions for ARM_SW pin ***/
1133 #define ARM_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_2 )
1134 /*** Functions for ARMCF_AUTO_SW pin ***/
1135 #define ARMCF_AUTO_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_13 )
1136 /*** Functions for FIRE_SW_OFF pin ***/
1137 #define FIRE_SW_OFFStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_8 )
1138 /*** Functions for FIRE_SW_ON pin ***/
1139 #define FIRE_SW_ONStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_8 )
1140 /*** Functions for WL_SPS_POS_DET pin ***/
1141 #define WL_SPS_POS_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_12 )
1142 /*** Functions for WL_SPS_NEG_DET pin ***/
1143 #define WL_SPS_NEG_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_13 )
1144 #define MAN_CN_PORT_CHANNEL PORT_CHANNEL_A
1145 #define MAN_CN_PORT_BIT PORTS_BIT_POS_0
1146 #define MAN_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_A
1147 #define HVPS_CN_PORT_CHANNEL PORT_CHANNEL_J
1148 #define HVPS_CN_PORT_BIT PORTS_BIT_POS_11
1149 #define HVPS_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_J
1150 /*** Application Instance 0 Configuration ***/
1151 //DOM-IGNORE-BEGIN
1152 //DOM-IGNORE-END
1153  // _SYSTEM_CONFIG_H
1154 /*******************************************************************************
1155  End of File
1156 */
1157 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h*/
1158 /* CLOSE_FILE Include File */
1159 
1160 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\driver_common.h */
1161 /*******************************************************************************
1162  Driver Common Header Definitions
1163  Company:
1164  Microchip Technology Inc.
1165  File Name:
1166  drv_common.h
1167  Summary:
1168  This file defines the common macros and definitions used by the driver
1169  definition and implementation headers.
1170  Description:
1171  This file defines the common macros and definitions used by the driver
1172  definition and the implementation header.
1173  Remarks:
1174  The directory in which this file resides should be added to the compiler's
1175  search path for header files.
1176  *******************************************************************************/
1177 //DOM-IGNORE-BEGIN
1178 /*******************************************************************************
1179 Copyright (c) 2010-2013 released Microchip Technology Inc. All rights reserved.
1180 Microchip licenses to you the right to use, modify, copy and distribute
1181 Software only when embedded on a Microchip microcontroller or digital signal
1182 controller that is integrated into your product or third party product
1183 (pursuant to the sublicense terms in the accompanying license agreement).
1184 You should refer to the license agreement accompanying this Software for
1185 additional information regarding your rights and obligations.
1186 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
1187 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1188 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1189 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1190 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1191 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1192 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1193 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1194 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1195 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1196  *******************************************************************************/
1197 //DOM-IGNORE-END
1198 #ifndef _DRV_COMMON_H
1199 #define _DRV_COMMON_H
1200 #include <stdint.h>
1201 #include <stddef.h>
1202 // *****************************************************************************
1203 /* Device Driver I/O Intent
1204  Summary:
1205  Identifies the intended usage of the device when it is opened.
1206  Description:
1207  This enumeration identifies the intended usage of the device when the
1208  caller opens the device. It identifies the desired behavior of the device
1209  driver for the following:
1210  * Blocking or non-blocking I/O behavior (do I/O calls such as read and write
1211  block until the operation is finished or do they return immediately and
1212  require the caller to call another routine to check the status of the
1213  operation)
1214  * Support reading and/or writing of data from/to the device
1215  * Identify the buffering behavior (sometimes called "double buffering" of
1216  the driver. Indicates if the driver should maintain its own read/write
1217  buffers and copy data to/from these buffers to/from the caller's buffers.
1218  * Identify the DMA behavior of the peripheral
1219  Remarks:
1220  The buffer allocation method is not identified by this enumeration. Buffers
1221  can be allocated statically at build time, dynamically at run-time, or
1222  even allocated by the caller and passed to the driver for its own usage if
1223  a driver-specific routine is provided for such. This choice is left to
1224  the design of the individual driver and is considered part of its
1225  interface.
1226  These values can be considered "flags". One selection from each of the
1227  groups below can be ORed together to create the complete value passed
1228  to the driver's open routine.
1229 */
1230 
1231 typedef
1232  enum
1233  {
1234  /* Read */
1235  DRV_IO_INTENT_READ /*DOM-IGNORE-BEGIN*/
1236  = 1 << 0 /* DOM-IGNORE-END*/
1237  ,
1238  /* Write */
1239  DRV_IO_INTENT_WRITE /*DOM-IGNORE-BEGIN*/
1240  = 1 << 1 /* DOM-IGNORE-END*/
1241  ,
1242  /* Read and Write*/
1243  DRV_IO_INTENT_READWRITE /*DOM-IGNORE-BEGIN*/
1244  = DRV_IO_INTENT_READ | DRV_IO_INTENT_WRITE /* DOM-IGNORE-END*/
1245  ,
1246  /* The driver will block and will return when the operation is complete */
1247  DRV_IO_INTENT_BLOCKING /*DOM-IGNORE-BEGIN*/
1248  = 0 << 2 /* DOM-IGNORE-END*/
1249  ,
1250  /* The driver will return immediately */
1251  DRV_IO_INTENT_NONBLOCKING /*DOM-IGNORE-BEGIN*/
1252  = 1 << 2 /* DOM-IGNORE-END*/
1253  ,
1254  /* The driver will support only one client at a time */
1255  DRV_IO_INTENT_EXCLUSIVE /*DOM-IGNORE-BEGIN*/
1256  = 1 << 3 /* DOM-IGNORE-END*/
1257  ,
1258  /* The driver will support multiple clients at a time */
1259  DRV_IO_INTENT_SHARED /*DOM-IGNORE-BEGIN*/
1260  = 0 << 3 /* DOM-IGNORE-END*/
1261  } DRV_IO_INTENT ;
1262 // *****************************************************************************
1263 /* Driver Client Status
1264  Summary:
1265  Identifies the current status/state of a client's connection to a driver.
1266  Description:
1267  This enumeration identifies the current status/state of a client's link to
1268  a driver.
1269  Remarks:
1270  The enumeration used as the return type for the client-level status routines
1271  defined by each device driver or system module (for example,
1272  DRV_USART_ClientStatus) must be based on the values in this enumeration.
1273 */
1274 
1275 typedef
1276  enum
1277  {
1278  /* Indicates that a driver-specific error has occurred. */
1280  /* An unspecified error has occurred.*/
1282  /* The driver is closed, no operations for this client are ongoing,
1283  and/or the given handle is invalid. */
1285  /* The driver is currently busy and cannot start additional operations. */
1287  /* The module is running and ready for additional operations */
1289  /* Indicates that the module is in a driver-specific ready/run state. */
1291  } DRV_CLIENT_STATUS ;
1292 // *****************************************************************************
1293 /* Device Driver Blocking Status Macro
1294  Summary:
1295  Returns if the I/O intent provided is blocking
1296  Description:
1297  This macro returns if the I/O intent provided is blocking.
1298  Remarks:
1299  None.
1300 */
1301 #define DRV_IO_ISBLOCKING( intent ) ( intent & DRV_IO_INTENT_BLOCKING )
1302 // *****************************************************************************
1303 /* Device Driver Non Blocking Status Macro
1304  Summary:
1305  Returns if the I/O intent provided is non-blocking.
1306  Description:
1307  This macro returns if the I/ intent provided is non-blocking.
1308  Remarks:
1309  None.
1310 */
1311 #define DRV_IO_ISNONBLOCKING( intent ) ( intent & DRV_IO_INTENT_NONBLOCKING )
1312 // *****************************************************************************
1313 /* Device Driver Exclusive Status Macro
1314  Summary:
1315  Returns if the I/O intent provided is non-blocking.
1316  Description:
1317  This macro returns if the I/O intent provided is non-blocking.
1318  Remarks:
1319  None.
1320 */
1321 #define DRV_IO_ISEXCLUSIVE( intent ) ( intent & DRV_IO_INTENT_EXCLUSIVE )
1322 // *****************************************************************************
1323 /* Device Driver IO Buffer Identifier
1324  Summary:
1325  Identifies to which buffer a device operation will apply.
1326  Description:
1327  This enumeration identifies to which buffer (read, write, both, or neither)
1328  a device operation will apply. This is used for "flush" (or similar)
1329  operations.
1330 */
1331 
1332 typedef
1333  enum
1334  {
1335  // Operation does not apply to any buffer
1337  // Operation applies to read buffer
1339  // Operation applies to write buffer
1341  // Operation applies to both read and write buffers
1344 // *****************************************************************************
1345 /* Device Handle
1346  Summary:
1347  Handle to an opened device driver.
1348  Description:
1349  This handle identifies the open instance of a device driver. It must be
1350  passed to all other driver routines (except the initialization, deinitialization,
1351  or power routines) to identify the caller.
1352  Remarks:
1353  Every application or module that wants to use a driver must first call
1354  the driver's open routine. This is the only routine that is absolutely
1355  required for every driver.
1356  If a driver is unable to allow an additional module to use it, it must then
1357  return the special value DRV_HANDLE_INVALID. Callers should check the
1358  handle returned for this value to ensure this value was not returned before
1359  attempting to call any other driver routines using the handle.
1360 */
1361 
1362 typedef
1363 uintptr_t
1365 // *****************************************************************************
1366 /* Invalid Device Handle
1367  Summary:
1368  Invalid device handle.
1369  Description:
1370  If a driver is unable to allow an additional module to use it, it must then
1371  return the special value DRV_HANDLE_INVALID. Callers should check the
1372  handle returned for this value to ensure this value was not returned before
1373  attempting to call any other driver routines using the handle.
1374  Remarks:
1375  None.
1376 */
1377 #define DRV_HANDLE_INVALID ( ( ( DRV_HANDLE ) - 1 ) )
1378 // *****************************************************************************
1379 /* Not supported configuration
1380  Summary:
1381  Not supported configuration.
1382  Description:
1383  If the configuration option is not supported on an instance of the
1384  peripheral, use this macro to equate to that configuration. This option
1385  should be listed as a possible value in the description of that
1386  configuration option.
1387 */
1388 #define DRV_CONFIG_NOT_SUPPORTED ( ( ( unsigned short ) - 1 ) )
1389 // *****************************************************************************
1390 /* Unsupported Attribute Abstraction
1391  Summary:
1392  Abstracts the use of the unsupported attribute defined by the compiler.
1393  Description:
1394  This macro nulls the definition of the _PLIB_UNSUPPORTED macro, to support
1395  compilation of the drivers for all different variants.
1396  Example:
1397  void _PLIB_UNSUPPORTED PLIB_USART_Enable(USART_MODULE_ID index);
1398  This function will not generate a compiler error if the interface is not
1399  defined for the selected device.
1400  Remarks:
1401  None.
1402 */
1403 #define _PLIB_UNSUPPORTED
1404  //_DRV_COMMON_H
1405 /*******************************************************************************
1406  End of File
1407 */
1408 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\driver_common.h*/
1409 /* CLOSE_FILE Include File */
1410 
1411 #include "system/common/sys_module.h"
1412 // *****************************************************************************
1413 /* IC Driver Module Index Numbers
1414  Summary:
1415  IC driver index definitions.
1416  Description:
1417  These constants provide IC Driver index definitions.
1418  Remarks:
1419  These constants should be used in place of hard-coded numeric literals.
1420  These values should be passed into the DRV_IC_Initialize and
1421  DRV_IC_Open routines to identify the driver instance in use.
1422 */
1423 #define DRV_IC_INDEX_0 0
1424 #define DRV_IC_INDEX_1 1
1425 #define DRV_IC_INDEX_2 2
1426 #define DRV_IC_INDEX_3 3
1427 #define DRV_IC_INDEX_4 4
1428 #define DRV_IC_INDEX_5 5
1429 #define DRV_IC_INDEX_6 6
1430 #define DRV_IC_INDEX_7 7
1431 #define DRV_IC_INDEX_8 8
1432 #define DRV_IC_INDEX_9 9
1433 #define DRV_IC_INDEX_10 10
1434 #define DRV_IC_INDEX_11 11
1435 #define DRV_IC_INDEX_12 12
1436 #define DRV_IC_INDEX_13 13
1437 #define DRV_IC_INDEX_14 14
1438 #define DRV_IC_INDEX_15 15
1439 // *****************************************************************************
1440 // *****************************************************************************
1441 // Section: Interface Headers for the static driver
1442 // *****************************************************************************
1443 // *****************************************************************************
1444 // *****************************************************************************
1445 /* Function:
1446  SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index,
1447  const SYS_MODULE_INIT * const init);
1448  Summary:
1449  Initializes the Input Capture instance for the specified driver index.
1450  <p><b>Implementation:</b> Static</p>
1451  Description:
1452  This routine initializes the Input Capture driver instance for the specified
1453  driver instance, making it ready for clients to use it. The initialization
1454  routine is specified by the MHC parameters. The driver instance index is
1455  independent of the Input Capture module ID. For example, driver instance 0
1456  can be assigned to Input Capture 2.
1457  Precondition:
1458  None.
1459  Parameters:
1460  None.
1461  Returns:
1462  None.
1463  Remarks:
1464  This routine must be called before any other Input Capture routine is called.
1465  This routine should only be called once during system initialization.
1466 */
1467 
1468 SYS_MODULE_OBJ
1470  const SYS_MODULE_INDEX index ,
1471  const SYS_MODULE_INIT * const init ) ;
1472 // *****************************************************************************
1473 /* Function:
1474 DRV_HANDLE DRV_IC_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1475  Summary:
1476  Opens the Input Capture instance for the specified driver index.
1477  <p><b>Implementation:</b> Static</p>
1478  Description:
1479  This routine starts the Input Capture driver for the specified driver
1480  index, starting an input capture.
1481  Precondition:
1482  DRV_IC_Initialize has been called.
1483  Parameters:
1484  None.
1485  Returns:
1486  None.
1487  Remarks:
1488  None.
1489 */
1490 
1491 DRV_HANDLE
1492  DRV_IC_Open (
1493  const SYS_MODULE_INDEX drvIndex ,
1494  const DRV_IO_INTENT intent ) ;
1495 // *****************************************************************************
1496 /* Function:
1497  void DRV_IC_Close(DRV_HANDLE handle)
1498  Summary:
1499  Closes the Input Capture instance for the specified driver index.
1500  <p><b>Implementation:</b> Static</p>
1501  Description:
1502  This routine stops the Input Capture driver for the specified driver
1503  index, stopping an input capture.
1504  Precondition:
1505  DRV_IC_Initialize has been called.
1506  Parameters:
1507  None.
1508  Returns:
1509  None.
1510  Remarks:
1511  None.
1512 */
1513 
1514 void
1515  DRV_IC_Close (
1516  DRV_HANDLE handle ) ;
1517 // *****************************************************************************
1518 /* Function:
1519 DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1520  Summary:
1521  Starts the Input Capture instance for the specified driver index.
1522  <p><b>Implementation:</b> Static</p>
1523  Description:
1524  This routine starts the Input Capture driver for the specified driver
1525  index, starting an input capture.
1526  Precondition:
1527  DRV_IC_Initialize has been called.
1528  Parameters:
1529  None.
1530  Returns:
1531  None.
1532  Remarks:
1533  None.
1534 */
1535 
1536 DRV_HANDLE
1537  DRV_IC_Start (
1538  const SYS_MODULE_INDEX drvIndex ,
1539  const DRV_IO_INTENT intent ) ;
1540 // *****************************************************************************
1541 /* Function:
1542  void DRV_IC_Stop(DRV_HANDLE handle)
1543  Summary:
1544  Stops the Input Capture instance for the specified driver index.
1545  <p><b>Implementation:</b> Static</p>
1546  Description:
1547  This routine stops the Input Capture driver for the specified driver
1548  index, stopping an input capture.
1549  Precondition:
1550  DRV_IC_Initialize has been called.
1551  Parameters:
1552  None.
1553  Returns:
1554  None.
1555  Remarks:
1556  None.
1557 */
1558 
1559 void
1560  DRV_IC_Stop (
1561  DRV_HANDLE handle ) ;
1562 // *****************************************************************************
1563 /* Function:
1564  uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
1565  Summary:
1566  Reads the 32-bit Input Capture for the specified driver index.
1567  <p><b>Implementation:</b> Static</p>
1568  Description:
1569  This routine reads the 32-bit data for the specified driver index
1570  Precondition:
1571  DRV_IC_Initialize has been called.
1572  Parameters:
1573  None.
1574  Returns:
1575  uint32_t value of the data read from the Input Capture.
1576  Remarks:
1577  None.
1578 */
1579 
1580 uint32_t
1582  DRV_HANDLE handle ) ;
1583 // *****************************************************************************
1584 /* Function:
1585  uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
1586  Summary:
1587  Reads the 16-bit Input Capture for the specified driver index.
1588  <p><b>Implementation:</b> Static</p>
1589  Description:
1590  This routine reads the 16-bit data for the specified driver index.
1591  Precondition:
1592  DRV_IC_Initialize has been called.
1593  Parameters:
1594  None.
1595  Returns:
1596  uint16_t value of the data read from the Input Capture.
1597  Remarks:
1598  None.
1599 */
1600 
1601 uint16_t
1603  DRV_HANDLE handle ) ;
1604 // *****************************************************************************
1605 /* Function:
1606  bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
1607  Summary:
1608  Returns the Input Capture instance buffer empty status for the specified driver
1609  index.
1610  <p><b>Implementation:</b> Static</p>
1611  Description:
1612  Returns the Input Capture instance buffer empty status for the specified driver
1613  index. The function should be called to determine whether or not the IC buffer
1614  has data.
1615  Precondition:
1616  DRV_IC_Initialize has been called.
1617  Parameters:
1618  None.
1619  Returns:
1620  Boolean
1621  - 1 - Buffer is empty
1622  - 0 - Buffer is not empty
1623  Remarks:
1624  None.
1625 */
1626 
1627 bool
1629  DRV_HANDLE handle ) ;
1630 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h */
1631 /*******************************************************************************
1632  IC Driver Interface Declarations for Static Single Instance Driver
1633  Company:
1634  Microchip Technology Inc.
1635  File Name:
1636  drv_ic_static.h
1637  Summary:
1638  IC driver interface declarations for the static single instance driver.
1639  Description:
1640  The IC device driver provides a simple interface to manage the IC
1641  modules on Microchip microcontrollers. This file defines the interface
1642  Declarations for the IC driver.
1643 
1644  Remarks:
1645  Static interfaces incorporate the driver instance number within the names
1646  of the routines, eliminating the need for an object ID or object handle.
1647 
1648  Static single-open interfaces also eliminate the need for the open handle.
1649 *******************************************************************************/
1650 //DOM-IGNORE-BEGIN
1651 /*******************************************************************************
1652 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1653 Microchip licenses to you the right to use, modify, copy and distribute
1654 Software only when embedded on a Microchip microcontroller or digital signal
1655 controller that is integrated into your product or third party product
1656 (pursuant to the sublicense terms in the accompanying license agreement).
1657 You should refer to the license agreement accompanying this Software for
1658 additional information regarding your rights and obligations.
1659 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1660 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1661 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1662 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1663 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1664 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1665 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1666 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1667 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1668 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1669 *******************************************************************************/
1670 //DOM-IGNORE-END
1671 #ifndef _DRV_IC_STATIC_H
1672 #define _DRV_IC_STATIC_H
1673 #define DRV_IC_Open( drvIndex , intent ) ( drvIndex )
1674 #define DRV_IC_Close( handle )
1675 // *****************************************************************************
1676 // *****************************************************************************
1677 // Section: Interface Headers for Instance 0 for the static driver
1678 // *****************************************************************************
1679 // *****************************************************************************
1680 
1681 void
1682  DRV_IC0_Initialize ( void ) ;
1683 
1684 void
1685  DRV_IC0_Start ( void ) ;
1686 
1687 void
1688  DRV_IC0_Stop ( void ) ;
1689 
1690 uint32_t
1691  DRV_IC0_Capture32BitDataRead ( void ) ;
1692 
1693 uint16_t
1694  DRV_IC0_Capture16BitDataRead ( void ) ;
1695 
1696 bool
1697  DRV_IC0_BufferIsEmpty ( void ) ;
1698  // #ifndef _DRV_IC_STATIC_H
1699 /*******************************************************************************
1700  End of File
1701 */
1702 
1703 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h*/
1704 /* CLOSE_FILE Include File */
1705 
1706  // #ifndef _DRV_IC_H
1707 /*******************************************************************************
1708  End of File
1709 */
1710 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h*/
1711 /* CLOSE_FILE Include File */
1712 
1713 #include "system/devcon/sys_devcon.h"
1714 #include "system/clk/sys_clk.h"
1715 #include "system/int/sys_int.h"
1716 #include "system/tmr/sys_tmr.h"
1717 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h */
1718 /*******************************************************************************
1719  ADC Driver Interface Declarations for Static Single Instance Driver
1720  Company:
1721  Microchip Technology Inc.
1722  File Name:
1723  drv_adc_static.h
1724  Summary:
1725  ADC driver interface declarations for the static single instance driver.
1726  Description:
1727  The ADC device driver provides a simple interface to manage the ADC
1728  modules on Microchip microcontrollers. This file defines the interface
1729  Declarations for the ADC driver.
1730 
1731  Remarks:
1732  Static interfaces incorporate the driver instance number within the names
1733  of the routines, eliminating the need for an object ID or object handle.
1734 
1735  Static single-open interfaces also eliminate the need for the open handle.
1736 *******************************************************************************/
1737 //DOM-IGNORE-BEGIN
1738 /*******************************************************************************
1739 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1740 Microchip licenses to you the right to use, modify, copy and distribute
1741 Software only when embedded on a Microchip microcontroller or digital signal
1742 controller that is integrated into your product or third party product
1743 (pursuant to the sublicense terms in the accompanying license agreement).
1744 You should refer to the license agreement accompanying this Software for
1745 additional information regarding your rights and obligations.
1746 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1747 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1748 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1749 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1750 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1751 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1752 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1753 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1754 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1755 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1756 *******************************************************************************/
1757 //DOM-IGNORE-END
1758 #ifndef _DRV_ADC_STATIC_H
1759 #define _DRV_ADC_STATIC_H
1760 #include <stdbool.h>
1761 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1762 #include "peripheral/adchs/plib_adchs.h"
1763 #include "peripheral/int/plib_int.h"
1764 
1765 typedef
1766  enum
1767  {
1768  DRV_ADC_ID_1 = ADCHS_ID_0 ,
1770  } DRV_ADC_MODULE_ID ;
1771 // *****************************************************************************
1772 // *****************************************************************************
1773 // Section: Interface Headers for ADC Static Driver
1774 // *****************************************************************************
1775 // *****************************************************************************
1776 
1777 void
1778  DRV_ADC_Initialize ( void ) ;
1779 
1780 inline void
1781  DRV_ADC_DeInitialize ( void ) ;
1782 
1783 inline void
1784  DRV_ADC0_Open ( void ) ;
1785 
1786 inline void
1787  DRV_ADC0_Close ( void ) ;
1788 
1789 inline void
1790  DRV_ADC1_Open ( void ) ;
1791 
1792 inline void
1793  DRV_ADC1_Close ( void ) ;
1794 
1795 inline void
1796  DRV_ADC_Start ( void ) ;
1797 
1798 inline void
1799  DRV_ADC_Stop ( void ) ;
1800 
1801 uint32_t
1803  uint8_t bufIndex ) ;
1804 
1805 bool
1807  uint8_t bufIndex ) ;
1808  // #ifndef _DRV_ADC_STATIC_H
1809 /*******************************************************************************
1810  End of File
1811 */
1812 
1813 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h*/
1814 /* CLOSE_FILE Include File */
1815 
1816 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h */
1817 /*******************************************************************************
1818  Timer Driver Interface Declarations for Static Single Instance Driver
1819  Company:
1820  Microchip Technology Inc.
1821  File Name:
1822  drv_tmr_static.h
1823  Summary:
1824  Timer driver interface declarations for the static single instance driver.
1825  Description:
1826  The Timer device driver provides a simple interface to manage the Timer
1827  modules on Microchip microcontrollers. This file defines the interface
1828  Declarations for the TMR driver.
1829 
1830  Remarks:
1831  Static interfaces incorporate the driver instance number within the names
1832  of the routines, eliminating the need for an object ID or object handle.
1833 
1834  Static single-open interfaces also eliminate the need for the open handle.
1835 *******************************************************************************/
1836 //DOM-IGNORE-BEGIN
1837 /*******************************************************************************
1838 Copyright (c) 2014 released Microchip Technology Inc. All rights reserved.
1839 Microchip licenses to you the right to use, modify, copy and distribute
1840 Software only when embedded on a Microchip microcontroller or digital signal
1841 controller that is integrated into your product or third party product
1842 (pursuant to the sublicense terms in the accompanying license agreement).
1843 You should refer to the license agreement accompanying this Software for
1844 additional information regarding your rights and obligations.
1845 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1846 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1847 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTOCULAR PURPOSE.
1848 IN NO EVENT SHALL MOCROCHIP OR ITS LOCENSORS BE LIABLE OR OBLIGATED UNDER
1849 CONTRACT, NEGLIGENCE, STROCT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1850 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1851 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1852 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1853 SUBSTITUTE GOODS, TECHNOLOGY, SERVOCES, OR ANY CLAIMS BY THIRD PARTIES
1854 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1855 *******************************************************************************/
1856 //DOM-IGNORE-END
1857 #ifndef _DRV_TMR_STATIC_H
1858 #define _DRV_TMR_STATIC_H
1859 // *****************************************************************************
1860 // *****************************************************************************
1861 // Section: Include Headers
1862 // *****************************************************************************
1863 // *****************************************************************************
1864 #include <stdint.h>
1865 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h */
1866 /*******************************************************************************
1867  Timer Device Driver Interface Definition
1868  Company:
1869  Microchip Technology Inc.
1870  File Name:
1871  drv_tmr.h
1872  Summary:
1873  Timer device driver interface header file.
1874  Description:
1875  This header file contains the function prototypes and definitions of the
1876  data types and constants that make up the interface to the Timer device
1877  driver.
1878 *******************************************************************************/
1879 //DOM-IGNORE-BEGIN
1880 /*******************************************************************************
1881 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1882 Microchip licenses to you the right to use, modify, copy and distribute
1883 Software only when embedded on a Microchip microcontroller or digital signal
1884 controller that is integrated into your product or third party product
1885 (pursuant to the sublicense terms in the accompanying license agreement).
1886 You should refer to the license agreement accompanying this Software for
1887 additional information regarding your rights and obligations.
1888 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1889 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1890 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1891 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1892 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1893 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1894 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1895 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1896 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1897 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1898 *******************************************************************************/
1899 //DOM-IGNORE-END
1900 #ifndef _DRV_TMR_H
1901 #define _DRV_TMR_H
1902 // *****************************************************************************
1903 // *****************************************************************************
1904 // Section: File includes
1905 // *****************************************************************************
1906 // *****************************************************************************
1907 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1908 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
1909 #include "peripheral/tmr/plib_tmr.h"
1910 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h */
1911 /*******************************************************************************
1912  Timer Device Driver Interface Definition
1913  Company:
1914  Microchip Technology Inc.
1915  File Name:
1916  tmr_definitions_pic32m.h
1917  Summary:
1918  Timer device driver definitions header file.
1919  Description:
1920  This header file contains the definitions of the
1921  data types and constants that make up the interface to the Timer device
1922  driver.
1923 *******************************************************************************/
1924 //DOM-IGNORE-BEGIN
1925 /*******************************************************************************
1926 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1927 Microchip licenses to you the right to use, modify, copy and distribute
1928 Software only when embedded on a Microchip microcontroller or digital signal
1929 controller that is integrated into your product or third party product
1930 (pursuant to the sublicense terms in the accompanying license agreement).
1931 You should refer to the license agreement accompanying this Software for
1932 additional information regarding your rights and obligations.
1933 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1934 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1935 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1936 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1937 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1938 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1939 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1940 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1941 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1942 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1943 *******************************************************************************/
1944 //DOM-IGNORE-END
1945 #ifndef _TMR_DEFINITIONS_PIC32M_H
1946 #define _TMR_DEFINITIONS_PIC32M_H
1947 // DOM-IGNORE-BEGIN
1948 // DOM-IGNORE-END
1949 
1950 typedef
1951  enum
1952  {
1953  /* Clock input to the timer module is internal(Peripheral Clock) */
1955  /*DOM-IGNORE-BEGIN*/
1956  = 0x00 /*DOM-IGNORE-END*/
1957  ,
1958  /* Clock input to the timer module is from T1CK pin (external)
1959  with clock synchronization enabled */
1961  /*DOM-IGNORE-BEGIN*/
1962  = 0x01 /*DOM-IGNORE-END*/
1963  ,
1964  /* Clock input to the timer module is from T1CK pin (external)
1965  with clock synchronization disabled */
1967  /*DOM-IGNORE-BEGIN*/
1968  = 0x11 /*DOM-IGNORE-END*/
1969  ,
1970  /* Clock input to the timer module is from secondary oscillator (external)
1971  with clock synchronization enabled */
1973  /*DOM-IGNORE-BEGIN*/
1974  = 0x02 /*DOM-IGNORE-END*/
1975  ,
1976  /* Clock input to the timer module is from secondary oscillator (external)
1977  with clock synchronization disabled */
1979  /*DOM-IGNORE-BEGIN*/
1980  = 0x12 /*DOM-IGNORE-END*/
1981  ,
1982  /* Clock input to the timer module is from LPRC
1983  with clock synchronization enabled */
1985  /*DOM-IGNORE-BEGIN*/
1986  = 0x03 /*DOM-IGNORE-END*/
1987  ,
1988  /* Clock input to the timer module is from LPRC
1989  with clock synchronization disabled */
1991  /*DOM-IGNORE-BEGIN*/
1992  = 0x13 /*DOM-IGNORE-END*/
1994 //DOM-IGNORE-BEGIN
1995 //DOM-IGNORE-END
1996  // #ifndef _DRV_TMR_H
1997 /*******************************************************************************
1998  End of File
1999 */
2000 
2001 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h*/
2002 /* CLOSE_FILE Include File */
2003 
2004 #include "system/int/sys_int.h" // System Interrupt Definitions
2005 #include "system/clk/sys_clk.h"
2006 // DOM-IGNORE-BEGIN
2007 // DOM-IGNORE-END
2008 // *****************************************************************************
2009 // *****************************************************************************
2010 // Section: TMR Driver Data Types
2011 // *****************************************************************************
2012 // *****************************************************************************
2013 // *****************************************************************************
2014 /* Timer Driver Module Index Numbers
2015  Summary:
2016  Timer driver index definitions
2017  Description:
2018  These constants provide Timer driver index definitions.
2019  Remarks:
2020  These constants should be used in place of hard-coded numeric literals.
2021  These values should be passed into the DRV_TMR_Initialize and DRV_TMR_Open
2022  functions to identify the driver instance in use.
2023 */
2024 #define DRV_TMR_INDEX_0 0
2025 #define DRV_TMR_INDEX_1 1
2026 #define DRV_TMR_INDEX_2 2
2027 #define DRV_TMR_INDEX_3 3
2028 #define DRV_TMR_INDEX_4 4
2029 #define DRV_TMR_INDEX_5 5
2030 #define DRV_TMR_INDEX_6 6
2031 #define DRV_TMR_INDEX_7 7
2032 #define DRV_TMR_INDEX_8 8
2033 #define DRV_TMR_INDEX_9 9
2034 #define DRV_TMR_INDEX_10 10
2035 #define DRV_TMR_INDEX_11 11
2036 // *****************************************************************************
2037 /* Timer Driver Module Index Count
2038  Summary:
2039  Number of valid Timer driver indices.
2040  Description:
2041  This constant identifies Timer driver index definitions.
2042  Remarks:
2043  This constant should be used in place of hard-coded numeric literals.
2044  This value is device-specific.
2045 */
2046 #define DRV_TMR_INDEX_COUNT TMR_NUMBER_OF_MODULES
2047 // *****************************************************************************
2048 /* Timer Driver Client Status
2049  Summary:
2050  Identifies the client-specific status of the Timer driver
2051  Description:
2052  This enumeration identifies the client-specific status of the Timer driver.
2053  Remarks:
2054  None.
2055 */
2056 
2057 typedef
2058  enum
2059  {
2060  /* Driver is invalid (or unopened) state */
2062  /*DOM-IGNORE-BEGIN*/
2063  = DRV_CLIENT_STATUS_ERROR /*DOM-IGNORE-END*/
2064  ,
2065  /* An operation is currently in progress */
2067  /*DOM-IGNORE-BEGIN*/
2068  = DRV_CLIENT_STATUS_BUSY /*DOM-IGNORE-END*/
2069  ,
2070  /* Ready, no operations running */
2072  /*DOM-IGNORE-BEGIN*/
2073  = DRV_CLIENT_STATUS_READY + 0 /*DOM-IGNORE-END*/
2074  ,
2075  /* Timer started and running, processing transactions */
2077  /*DOM-IGNORE-BEGIN*/
2078  = DRV_CLIENT_STATUS_READY + 1 /*DOM-IGNORE-END*/
2080 // *****************************************************************************
2081 /* Timer Driver Clock sources
2082  Summary:
2083  Lists the clock sources available for timer driver.
2084  Description:
2085  This enumeration lists all the available clock sources for the timer
2086  hardware.
2087  Remarks:
2088  Not all modes are available on all devices.
2089  'Synchronization' may not be applicable for all the instances of the timer.
2090  The driver discards the Synchronization mode selected if it is not
2091  applicable for the selected hardware.
2092 */
2093 // *****************************************************************************
2094 /* Timer Driver Operation mode
2095  Summary:
2096  Lists the operation modes available for timer driver.
2097  Description:
2098  This enumeration lists all the available operation modes that are valid for
2099  the timer hardware.
2100  Remarks:
2101  Not all modes are available on all devices.
2102 */
2103 
2104 typedef
2105  enum
2106  {
2107  /* The timer module operating mode none/invalid */
2109  /* The timer module operates in 16 bit mode */
2111  /* The timer module operates in 32 bit mode */
2112  /* This will combine two 16 bit timer modules */
2115 // *****************************************************************************
2116 /* Timer Driver divider operating specification
2117  Summary:
2118  This data structure specifies the divider values that can be obtained by the
2119  timer module.
2120  Description:
2121  This data structure specifies the divider values that can be obtained by the
2122  timer hardware.
2123  Remarks:
2124  None.
2125 */
2126 
2127 typedef
2128  struct
2129  {
2130  /* The minimum divider value that the timer module can obtain */
2131  uint32_t dividerMin ;
2132  /* The maximum divider value that the timer module can obtain */
2133  uint32_t dividerMax ;
2134  /* The divider step value, between 2 divider values */
2135  /* Should be 1 for most timers */
2136  uint32_t dividerStep ;
2138 // *****************************************************************************
2139 /* Timer Driver Initialize Data
2140  Summary:
2141  Defines the Timer driver initialization data.
2142  Description:
2143  This data type defines data required to initialize the Timer driver.
2144  Remarks:
2145  Not all initialization features are available on all devices.
2146 */
2147 
2148 typedef
2149  struct
2150  {
2151  /* System module initialization. */
2152  SYS_MODULE_INIT moduleInit ;
2153  /* Identifies timer hardware module (PLIB-level) ID */
2154  TMR_MODULE_ID tmrId ;
2155  /* Clock Source select. */
2156  DRV_TMR_CLK_SOURCES clockSource ;
2157  /* Prescaler Selection from the processor enumeration */
2158  TMR_PRESCALE prescale ;
2159  /* Interrupt Source for TMR module. If 'DRV_TMR_OPERATION_MODE_32_BIT' flag
2160  is selected the interrupt will be generated by the 2nd timer of the pair,
2161  the odd numbered one. */
2162  INT_SOURCE interruptSource ;
2163  /* Select 16/32 bit operation mode. 32 bit mode will combine two 16 bit
2164  timer modules to form a 32 bit one. This is usually only necessary for
2165  very long delays. */
2166  DRV_TMR_OPERATION_MODE mode ;
2167  /* Asynchronous write enable configuration. If true the asynchronous write
2168  is enabled. For timers that do not support this feature the value is
2169  ignored */
2170  bool asyncWriteEnable ;
2171  } DRV_TMR_INIT ;
2172 // *****************************************************************************
2173 /* Timer Driver Callback Function Pointer
2174  Summary:
2175  Pointer to a Timer driver callback function data type.
2176  Description:
2177  This data type defines a pointer to a Timer driver callback function.
2178  Remarks:
2179  Useful only when timer alarm callback support is enabled by defining the
2180  DRV_TMR_ALARM_ENABLE configuration option.
2181 */
2182 
2183 typedef
2184 void ( * DRV_TMR_CALLBACK ) ( uintptr_t context ,
2185 uint32_t alarmCount ) ;
2186 // *****************************************************************************
2187 // *****************************************************************************
2188 // Section: Timer Driver Module Interface Functions
2189 // *****************************************************************************
2190 // *****************************************************************************
2191 // *****************************************************************************
2192 /* Function:
2193  SYS_MODULE_OBJ DRV_TMR_Initialize
2194  (
2195  const SYS_MODULE_INDEX drvIndex,
2196  const SYS_MODULE_INIT * const init
2197  )
2198  Summary:
2199  Initializes the Timer driver.
2200  <p><b>Implementation:</b> Static/Dynamic</p>
2201  Description:
2202  This function initializes the Timer driver, making it ready for clients to
2203  open and use it.
2204  Precondition:
2205  None.
2206  Parameters:
2207  drvIndex - Index for the driver instance to be initialized
2208  init - Pointer to a data structure containing any data necessary
2209  to initialize the driver.
2210  Returns:
2211  If successful, returns a valid handle to a driver object. Otherwise, it
2212  returns SYS_MODULE_OBJ_INVALID. The returned object must be passed as
2213  argument to DRV_TMR_Deinitialize, DRV_TMR_Tasks and DRV_TMR_Status functions.
2214  Example:
2215  <code>
2216  DRV_TMR_INIT init;
2217  SYS_MODULE_OBJ objectHandle;
2218  // Populate the timer initialization structure
2219  init.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
2220  init.tmrId = TMR_ID_2;
2221  init.clockSource = DRV_TMR_CLKSOURCE_INTERNAL;
2222  init.prescale = TMR_PRESCALE_VALUE_256;
2223  init.interruptSource = INT_SOURCE_TIMER_2;
2224  init.mode = DRV_TMR_OPERATION_MODE_16_BIT;
2225  init.asyncWriteEnable = false;
2226  // Do something
2227  objectHandle = DRV_TMR_Initialize ( DRV_TMR_INDEX_0, (SYS_MODULE_INIT*)&init );
2228  if ( SYS_MODULE_OBJ_INVALID == objectHandle )
2229  {
2230  // Handle error
2231  }
2232  </code>
2233  Remarks:
2234  This function must be called before any other Timer driver function is
2235  called.
2236  This function should only be called once during system initialization unless
2237  DRV_TMR_Deinitialize is called to deinitialize the driver instance.
2238  This function will NEVER block for hardware access. The system must use
2239  DRV_TMR_Status to find out when the driver is in the ready state.
2240  Build configuration options may be used to statically override options in
2241  the "init" structure and will take precedence over initialization data
2242  passed using this function.
2243 */
2244 
2245 SYS_MODULE_OBJ
2247  const SYS_MODULE_INDEX drvIndex ,
2248  const SYS_MODULE_INIT * const init ) ;
2249 // *****************************************************************************
2250 /* Function:
2251  void DRV_TMR_Deinitialize ( SYS_MODULE_OBJ object )
2252  Summary:
2253  Deinitializes the specified instance of the Timer driver.
2254  <p><b>Implementation:</b> Dynamic</p>
2255  Description:
2256  Deinitializes the specified instance of the Timer driver, disabling
2257  its operation (and any hardware). All internal data is invalidated.
2258  Precondition:
2259  The DRV_TMR_Initialize function must have been called before calling this
2260  function and a valid SYS_MODULE_OBJ must have been returned.
2261  Parameters:
2262  object - Driver object handle, returned from DRV_TMR_Initialize
2263  Returns:
2264  None.
2265  Example:
2266  <code>
2267  SYS_MODULE_OBJ tmrObject; // Returned from DRV_TMR_Initialize
2268  SYS_STATUS tmrStatus;
2269  DRV_TMR_Deinitialize ( tmrObject );
2270  tmrStatus = DRV_TMR_Status ( tmrObject );
2271  if ( SYS_MODULE_UNINITIALIZED == tmrStatus )
2272  {
2273  // Check again later if you need to know
2274  // when the driver is deinitialized.
2275  }
2276  </code>
2277  Remarks:
2278  Once the Initialize operation has been called, the Deinitialize operation
2279  must be called before the Initialize operation can be called again.
2280  This function will NEVER block waiting for hardware. If the operation
2281  requires time to allow the hardware to complete, this will be reported by
2282  the DRV_TMR_Status operation. The system has to use DRV_TMR_Status to find
2283  out when the module is in the ready state.
2284 */
2285 
2286 void
2288  SYS_MODULE_OBJ object ) ;
2289 // *****************************************************************************
2290 /* Function:
2291  SYS_STATUS DRV_TMR_Status ( SYS_MODULE_OBJ object )
2292  Summary:
2293  Provides the current status of the Timer driver.
2294  <p><b>Implementation:</b> Dynamic</p>
2295  Description:
2296  This function provides the current status of the Timer driver.
2297  Precondition:
2298  The DRV_TMR_Initialize function must have been called before calling this
2299  function.
2300  Parameters:
2301  object - Driver object handle, returned from DRV_TMR_Initialize
2302  Returns:
2303  SYS_STATUS_READY - Indicates that the driver is initialized and ready
2304  for operation
2305  Note: Any value greater than SYS_STATUS_READY is
2306  also a normal running state in which the driver
2307  is ready to accept new operations.
2308  SYS_STATUS_ERROR - Indicates that the driver is in an error state
2309  Note: Any value less than SYS_STATUS_ERROR is
2310  also an error state.
2311  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been deinitialized
2312  Note: This value is less than SYS_STATUS_ERROR.
2313  Example:
2314  <code>
2315  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
2316  SYS_STATUS tmrStatus;
2317  tmrStatus = DRV_TMR_Status ( object );
2318  else if ( SYS_STATUS_ERROR >= tmrStatus )
2319  {
2320  // Handle error
2321  }
2322  </code>
2323  Remarks:
2324  The this operation can be used to determine when any of the driver's module
2325  level operations has completed.
2326  Once the status operation returns SYS_STATUS_READY, the driver is ready for
2327  operation.
2328  The value of SYS_STATUS_ERROR is negative (-1). Any value less than that is
2329  also an error state.
2330  This function will NEVER block waiting for hardware.
2331 */
2332 
2333 SYS_STATUS
2334  DRV_TMR_Status (
2335  SYS_MODULE_OBJ object ) ;
2336 // *****************************************************************************
2337 /* Function:
2338  void DRV_TMR_Tasks ( SYS_MODULE_OBJ object )
2339  Summary:
2340  Maintains the driver's state machine.
2341  <p><b>Implementation:</b> Dynamic</p>
2342  Description:
2343  This function is used to maintain the driver's internal state machine and
2344  processes the timer events..
2345  Precondition:
2346  The DRV_TMR_Initialize function must have been called for the specified Timer
2347  driver instance.
2348  Parameters:
2349  object - Object handle for the specified driver instance (returned from
2350  DRV_TMR_Initialize)
2351  Returns:
2352  None
2353  Example:
2354  <code>
2355  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
2356  while (true)
2357  {
2358  DRV_TMR_Tasks ( object );
2359  // Do other tasks
2360  }
2361  </code>
2362  Remarks:
2363  This function is normally not called directly by an application. It is
2364  called by the system's Tasks routine (SYS_Tasks)
2365 */
2366 
2367 void
2368  DRV_TMR_Tasks (
2369  SYS_MODULE_OBJ object ) ;
2370 // *****************************************************************************
2371 // *****************************************************************************
2372 // Section: TMR Driver Client Functions
2373 // *****************************************************************************
2374 // *****************************************************************************
2375 // *****************************************************************************
2376 /* Function:
2377  DRV_HANDLE DRV_TMR_Open
2378  (
2379  const SYS_MODULE_INDEX index,
2380  const DRV_IO_INTENT intent
2381  )
2382  Summary:
2383  Opens the specified Timer driver instance and returns a handle to it.
2384  <p><b>Implementation:</b> Dynamic</p>
2385  Description:
2386  This function opens the specified Timer driver instance and provides a
2387  handle that must be provided to all other client-level operations to
2388  identify the caller and the instance of the driver. Timer driver does not
2389  support multiple clients. If two tasks want to use the timer, one should
2390  wait until the other one gets closed.
2391  Precondition:
2392  The DRV_TMR_Initialize function must have been called before calling this
2393  function.
2394  Parameters:
2395  index - Identifier for the object instance to be opened
2396  intent - Zero or more of the values from the enumeration
2397  DRV_IO_INTENT ORed together to indicate the intended use
2398  of the driver
2399  Returns:
2400  If successful, the function returns a valid open instance handle (a number
2401  identifying both the caller and the module instance).
2402  If an error occurs, the return value is DRV_HANDLE_INVALID.
2403  Example:
2404  <code>
2405  DRV_HANDLE handle;
2406  handle = DRV_TMR_Open ( DRV_TMR_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
2407  if ( DRV_HANDLE_INVALID == handle )
2408  {
2409  // Unable to open the driver
2410  }
2411  </code>
2412  Remarks:
2413  The handle returned is valid until the DRV_TMR_Close function is called.
2414  This function will NEVER block waiting for hardware.
2415  If the requested intent flags are not supported, the function will return
2416  DRV_HANDLE_INVALID.
2417  The Timer driver does not support DRV_IO_INTENT_SHARED.
2418  Only exclusive access is supported for now.
2419 */
2420 
2421 DRV_HANDLE
2422  DRV_TMR_Open (
2423  const SYS_MODULE_INDEX index ,
2424  const DRV_IO_INTENT intent ) ;
2425 // *****************************************************************************
2426 /* Function:
2427  void DRV_TMR_Close ( DRV_HANDLE handle )
2428  Summary:
2429  Closes an opened instance of the Timer driver.
2430  <p><b>Implementation:</b> Dynamic</p>
2431  Description:
2432  This function closes an opened instance of the Timer driver, invalidating
2433  the handle.
2434  Precondition:
2435  The DRV_TMR_Initialize function must have been called for the specified
2436  Timer driver instance.
2437  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2438  Parameters:
2439  handle - A valid open-instance handle, returned from the driver's
2440  open routine
2441  Returns:
2442  None
2443  Example:
2444  <code>
2445  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2446  DRV_TMR_Close ( handle );
2447  </code>
2448  Remarks:
2449  After calling this function, the handle passed in "handle" must not be used
2450  with any of the remaining driver functions. A new handle must be obtained
2451  by calling DRV_TMR_Open before the caller may use the driver again.
2452  Note: Usually there is no need for the driver client to verify that the Close
2453  operation has completed.
2454 */
2455 
2456 void
2457  DRV_TMR_Close (
2458  DRV_HANDLE handle ) ;
2459 // *****************************************************************************
2460 /* Function:
2461  DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus ( DRV_HANDLE handle )
2462  Summary:
2463  Gets the status of the client operation.
2464  <p><b>Implementation:</b> Dynamic</p>
2465  Description:
2466  This function gets the status of the recently completed client level
2467  operation.
2468  Precondition:
2469  The DRV_TMR_Initialize function must have been called for the specified
2470  Timer driver instance.
2471  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2472  Parameters:
2473  handle - A valid open-instance handle, returned from the driver's
2474  open routine
2475  Returns:
2476  None
2477  Example:
2478  <code>
2479  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2480  DRV_TMR_CLIENT_STATUS tmrDrvStatus;
2481  tmrDrvStatus = DRV_TMR_ClientStatus ( tmrHandle );
2482  </code>
2483  Remarks:
2484  None.
2485 */
2486 
2489  DRV_HANDLE handle ) ;
2490 // *****************************************************************************
2491 // *****************************************************************************
2492 // Section: TMR Driver Counting functions
2493 // *****************************************************************************
2494 // *****************************************************************************
2495 // *****************************************************************************
2496 /* Function:
2497  void DRV_TMR_CounterValueSet ( DRV_HANDLE handle, uint32_t counterPeriod )
2498  Summary:
2499  Updates the Timer's counter register.
2500  <p><b>Implementation:</b> Static/Dynamic</p>
2501  Description:
2502  This function updates the Timer's value in the counter register.
2503  Precondition:
2504  The DRV_TMR_Initialize function must have been called.
2505  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2506  Parameters:
2507  handle - A valid open-instance handle, returned from the driver's
2508  open routine
2509  counterPeriod - counter period value
2510  - a 16 bit value if the timer is configured in 16 bit mode
2511  - a 32 bit value if the timer is configured in 32 bit mode
2512  Returns:
2513  None.
2514  Example:
2515  <code>
2516  </code>
2517  Remarks:
2518  None.
2519 */
2520 
2521 void
2523  DRV_HANDLE handle ,
2524  uint32_t counterPeriod ) ;
2525 // *****************************************************************************
2526 /* Function:
2527  uint32_t DRV_TMR_CounterValueGet ( DRV_HANDLE handle )
2528  Summary:
2529  Reads the Timer's counter register.
2530  <p><b>Implementation:</b> Static/Dynamic</p>
2531  Description:
2532  This function returns the Timer's value in the counter register.
2533  Precondition:
2534  The DRV_TMR_Initialize function must have been called.
2535  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2536  Parameters:
2537  handle - A valid open-instance handle, returned from the driver's
2538  open routine
2539  Returns:
2540  Timer current period:
2541  - a 16 bit value if the timer is configured in 16 bit mode
2542  - a 32 bit value if the timer is configured in 32 bit mode
2543  Example:
2544  <code>
2545  //Example to use timer for precision time measurement
2546  //without configuring an alarm (interrupt based)
2547  char appState = 0;
2548  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2549  switch ( appState )
2550  {
2551  case 0:
2552  //Calculate and set the counter period
2553  DRV_TMR_CounterValueSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2554  //counter starts
2555  DRV_TMR_Start ( tmrHandle );
2556  //Trigger an application operation
2557  app_trigger_operation();
2558  //Check for time-out in the next state
2559  appState++;
2560  case 1:
2561  //Overflows and stops at 0 if no alarm is set
2562  if ( DRV_TMR_CounterValueGet ( tmrHandle ) == 0 )
2563  {
2564  //Time-out
2565  return false;
2566  }
2567  else if ( app_operation_isComplete( ) )
2568  {
2569  //Operation is complete before time-out
2570  return true;
2571  }
2572  </code>
2573  Remarks:
2574  None.
2575 */
2576 
2577 uint32_t
2579  DRV_HANDLE handle ) ;
2580 // *****************************************************************************
2581 /* Function:
2582  void DRV_TMR_CounterClear ( DRV_HANDLE handle )
2583  Summary:
2584  Clears the Timer's counter register.
2585  <p><b>Implementation:</b> Static/Dynamic</p>
2586  Description:
2587  This function clears the Timer's value in the counter register.
2588  Precondition:
2589  The DRV_TMR_Initialize function must have been called.
2590  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2591  Parameters:
2592  handle - A valid open-instance handle, returned from the driver's
2593  open routine
2594  Returns:
2595  None.
2596  Example:
2597  <code>
2598  </code>
2599  Remarks:
2600  None.
2601 */
2602 
2603 void
2605  DRV_HANDLE handle ) ;
2606 // *****************************************************************************
2607 /* Function:
2608  bool DRV_TMR_AlarmRegister
2609  (
2610  DRV_HANDLE handle,
2611  uint32_t divider,
2612  bool isPeriodic,
2613  uintptr_t context,
2614  DRV_TMR_CALLBACK callBack
2615  )
2616  Summary:
2617  Sets up an alarm.
2618  <p><b>Implementation:</b> Dynamic</p>
2619  Description:
2620  This function sets up an alarm, allowing the client to receive a callback
2621  from the driver when the timer counter reaches zero. Alarms can be one-shot
2622  or periodic. A periodic alarm will reload the timer and generate alarm
2623  until stopped. The alarm frequency is: DRV_TMR_CounterFrequencyGet() /
2624  divider;
2625  Precondition:
2626  The DRV_TMR_Initialize function must have been called.
2627  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2628  divider value has to be within the timer divider range (see DRV_TMR_DividerSpecGet).
2629  Parameters:
2630  handle - A valid handle, returned from DRV_TMR_Open
2631  divider - The value to divide the timer clock source to obtain the
2632  required alarm frequency.
2633  - a 16 bit value if the timer is configured in 16 bit mode
2634  - a 32 bit value if the timer is configured in 32 bit mode
2635  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
2636  context - A reference, call back function will be called with the same
2637  reference.
2638  callBack - A call back function which will be called on time out.
2639  Returns:
2640  - true - if the call succeeded
2641  - false - the obtained divider could not be obtained or the passed handle was invalid
2642  Example:
2643  <code>
2644  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
2645  void setupTask ()
2646  {
2647  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2648  uint32_t myFreq = 1000; // 1KHz
2649  uint32_t clkFreq = DRV_TMR_CounterFrequencyGet(tmrHandle); // timer running frequency
2650  // calculate the divider needed
2651  uint32_t divider = clkFreq / myFreq;
2652  // Start the alarm
2653  if(!DRV_TMR_AlarmRegister ( tmrHandle, divider, true, 0, CallBackFreq ))
2654  {
2655  // divider value could not be obtain;
2656  // handle the error
2657  //
2658  }
2659  }
2660  </code>
2661  Remarks:
2662  The divider value will be truncated to a 16 bit value if the timer is
2663  configured in 16 bit mode. The timer should be started using DRV_TMR_Start API to get a
2664  callback.
2665 */
2666 
2667 bool
2669  DRV_HANDLE handle ,
2670  uint32_t divider ,
2671  bool isPeriodic ,
2672  uintptr_t context ,
2673  DRV_TMR_CALLBACK callBack ) ;
2674 // *****************************************************************************
2675 /* Function:
2676  bool DRV_TMR_AlarmDisable ( DRV_HANDLE handle);
2677  Summary:
2678  Disables an alarm signal.
2679  <p><b>Implementation:</b> Dynamic</p>
2680  Description:
2681  This function allows the client to disable an alarm generation.
2682  Use DRV_TMR_AlarmEnable to re-enable.
2683  Precondition:
2684  The DRV_TMR_Initialize function must have been called.
2685  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2686  A client alarm must be active.
2687  Parameters:
2688  handle - A valid handle, returned from DRV_TMR_Open
2689  Returns:
2690  The current status of the alarm:
2691  - true if the alarm was currently enabled
2692  - false if the alarm was currently disabled
2693  Example:
2694  <code>
2695  </code>
2696  Remarks:
2697  When the driver operates in interrupts this call resolves to a device
2698  interrupt disable.
2699  Do NOT disable the timer except for very short periods of time. If the time
2700  that the interrupt is disabled is longer than a wrap around period and the
2701  interrupt is missed, the hardware has no means of recovering and the
2702  resulting timing will be inaccurate.
2703 */
2704 
2705 bool
2707  DRV_HANDLE handle ) ;
2708 // *****************************************************************************
2709 /* Function:
2710  void DRV_TMR_AlarmEnable ( DRV_HANDLE handle, bool enable );
2711  Summary:
2712  Re-enables an alarm signal.
2713  <p><b>Implementation:</b> Dynamic</p>
2714  Description:
2715  This function allows the client to re-enable an alarm after it has been
2716  disabled by a DRV_TMR_AlarmDisable call.
2717  Precondition:
2718  The DRV_TMR_Initialize function must have been called.
2719  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2720  Parameters:
2721  handle - A valid handle, returned from DRV_TMR_Open
2722  enable - boolean to enable the current callback
2723  Returns:
2724  None
2725  Example:
2726  <code>
2727  </code>
2728  Remarks:
2729  When the driver operates in interrupts this call resolves to a device
2730  interrupt re-enable.
2731 */
2732 
2733 void
2735  DRV_HANDLE handle ,
2736  bool enable ) ;
2737 // *****************************************************************************
2738 /* Function:
2739  void DRV_TMR_AlarmPeriodSet ( DRV_HANDLE handle, uint32_t value )
2740  Summary:
2741  Updates the Timer's period.
2742  <p><b>Implementation:</b> Dynamic</p>
2743  Description:
2744  This function updates the Timer's period.
2745  Precondition:
2746  The DRV_TMR_Initialize function must have been called.
2747  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2748  Parameters:
2749  handle - A valid open-instance handle, returned from the driver's
2750  open routine
2751  value - Period value
2752  - a 16 bit value if the timer is configured in 16 bit mode
2753  - a 32 bit value if the timer is configured in 32 bit mode
2754  Returns:
2755  None.
2756  Example:
2757  <code>
2758  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2759  DRV_TMR_AlarmPeriodSet ( handle, 0x1000 );
2760  </code>
2761  Remarks:
2762  - The period value will be truncated to a 16 bit value if the timer is
2763  configured in 16 bit mode.
2764 */
2765 
2766 void
2768  DRV_HANDLE handle ,
2769  uint32_t value ) ;
2770 // *****************************************************************************
2771 /* Function:
2772  uint32_t DRV_TMR_AlarmPeriodGet ( DRV_HANDLE handle )
2773  Summary:
2774  Provides the Timer's period.
2775  <p><b>Implementation:</b> Dynamic</p>
2776  Description:
2777  This function gets the Timer's period.
2778  Precondition:
2779  The DRV_TMR_Initialize function must have been called.
2780  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2781  Parameters:
2782  handle - A valid open-instance handle, returned from the driver's
2783  open routine
2784  Returns:
2785  Timer period value:
2786  - a 16 bit value if the timer is configured in 16 bit mode
2787  - a 32 bit value if the timer is configured in 32 bit mode
2788  Example:
2789  <code>
2790  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2791  uint32_t period;
2792  period = DRV_TMR_AlarmPeriodGet ( tmrHandle );
2793  </code>
2794  Remarks:
2795  None.
2796 */
2797 
2798 uint32_t
2800  DRV_HANDLE handle ) ;
2801 // *****************************************************************************
2802 /* Function:
2803  void DRV_TMR_AlarmDeregister ( DRV_HANDLE handle )
2804  Summary:
2805  Removes a previously set alarm.
2806  <p><b>Implementation:</b> Dynamic</p>
2807  Description:
2808  This function removes a previously set alarm.
2809  Precondition:
2810  The DRV_TMR_Initialize function must have been called.
2811  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2812  DRV_TMR_AlarmRegister function must have been called before.
2813  Parameters:
2814  handle - A valid open-instance handle, returned from the driver's
2815  open routine
2816  Returns:
2817  None.
2818  Example:
2819  <code>
2820  // Example of a key debounce check
2821  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
2822  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2823  void keyPressDetect ()
2824  {
2825  // Calculate the count to be passed on from the clock input
2826  DRV_TMR_AlarmRegister ( tmrHandle, 0xFF00, true, DebounceCheck );
2827  }
2828  void DebounceCheck ( uintptr_t context )
2829  {
2830  readKey = AppReadKey();
2831  if ( readKey != lastReadKey )
2832  {
2833  lastReadKey = readKey;
2834  keyCount = 0;
2835  }
2836  else
2837  {
2838  if ( keyCount > 20 )
2839  {
2840  globalKeyState = readKey;
2841  DRV_TMR_AlarmDeregister ( tmrHandle );
2842  }
2843  keyCount++;
2844  }
2845  }
2846  </code>
2847  Remarks:
2848  None.
2849 */
2850 
2851 void
2853  DRV_HANDLE handle ) ;
2854 // *****************************************************************************
2855 // *****************************************************************************
2856 // Section: TMR Driver Operation Control Functions
2857 // *****************************************************************************
2858 // *****************************************************************************
2859 // *****************************************************************************
2860 /* Function:
2861  bool DRV_TMR_Start ( DRV_HANDLE handle )
2862  Summary:
2863  Starts the Timer counting.
2864  <p><b>Implementation:</b> Static/Dynamic</p>
2865  Description:
2866  This function starts the Timer counting.
2867  Precondition:
2868  The DRV_TMR_Initialize function must have been called.
2869  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2870  Timer parameters must have been set by a call to DRV_TMR_AlarmRegister.
2871  Parameters:
2872  handle - A valid open-instance handle, returned from the driver's
2873  open routine
2874  Returns:
2875  - true - if the operation succeeded
2876  - false - the supplied handle is invalid or the client doesn't have
2877  the needed parameters to run (alarm callback and period )
2878  Example:
2879  <code>
2880  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2881  DRV_TMR_AlarmRegister(tmrHandle, 0x100, true, 0, myTmrCallback);
2882  DRV_TMR_Start ( tmrHandle );
2883  </code>
2884  Remarks:
2885  None.
2886 */
2887 
2888 bool
2889  DRV_TMR_Start (
2890  DRV_HANDLE handle ) ;
2891 // *****************************************************************************
2892 /* Function:
2893  void DRV_TMR_Stop ( DRV_HANDLE handle )
2894  Summary:
2895  Stops the Timer from counting.
2896  <p><b>Implementation:</b> Static/Dynamic</p>
2897  Description:
2898  This function stops the running Timer from counting.
2899  Precondition:
2900  The DRV_TMR_Initialize function must have been called.
2901  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2902  Parameters:
2903  handle - A valid open-instance handle, returned from the driver's
2904  open routine
2905  Returns:
2906  None.
2907  Example:
2908  <code>
2909  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2910  DRV_TMR_Stop ( handle );
2911  </code>
2912  Remarks:
2913  None.
2914 */
2915 
2916 void
2917  DRV_TMR_Stop (
2918  DRV_HANDLE handle ) ;
2919 // *****************************************************************************
2920 // *****************************************************************************
2921 // Section: TMR Driver Operation Status Functions
2922 // *****************************************************************************
2923 // *****************************************************************************
2924 // *****************************************************************************
2925 /* Function:
2926  unsigned int DRV_TMR_AlarmHasElapsed ( DRV_HANDLE handle )
2927  Summary:
2928  Provides the status of Timer's period elapse.
2929  <p><b>Implementation:</b> Dynamic</p>
2930  Description:
2931  This function returns the number of times Timer's period has elapsed since
2932  last call to this API has made. On calling this API, the internally
2933  maintained counter will be cleared and count will be started again from next
2934  elapse.
2935  Precondition:
2936  The DRV_TMR_Initialize function must have been called.
2937  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2938  Parameters:
2939  handle - A valid handle, returned from the DRV_TMR_Open
2940  Returns:
2941  Number of times timer has elapsed since the last call.
2942  Example:
2943  <code>
2944  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2945  bool elapseStatus;
2946  SYS_MODULE_OBJ tmrObject // Returned by DRV_TMR_Initialize
2947  unsigned int appInternalTime = 0;
2948  Sys_Tasks()
2949  {
2950  //Timer task will be called from ISR
2951  APP_TimeUpdate_Task();
2952  //Other Tasks
2953  }
2954  void APP_TimeUpdate_Task ( void )
2955  {
2956  //We will not miss a count even though we are late
2957  appInternalTime += DRV_TMR_AlarmHasElapsed ( tmrHandle );
2958  }
2959  </code>
2960  Remarks:
2961  None.
2962 */
2963 
2964 uint32_t
2966  DRV_HANDLE handle ) ;
2967 // *****************************************************************************
2968 // *****************************************************************************
2969 // Section: TMR Driver Control and Information Functions
2970 // *****************************************************************************
2971 // *****************************************************************************
2972 // *****************************************************************************
2973 /* Function:
2974  bool DRV_TMR_ClockSet
2975  (
2976  DRV_HANDLE handle,
2977  DRV_TMR_CLK_SOURCES clockSource,
2978  TMR_PRESCALE preScale
2979  )
2980  Summary:
2981  Sets the timers clock by selecting the source and prescaler.
2982  <p><b>Implementation:</b> Dynamic</p>
2983  Description:
2984  This function sets the timer clock by selecting the source and prescaler.
2985  The clock sources are device specific, refer device datasheet for supported
2986  clock sources. If unsupported clock source is passed then the behaviour of
2987  this function is unpredictable.
2988  Precondition:
2989  The DRV_TMR_Initialize function must have been called. Must have selected
2990  32-Bit timer mode if mode selection is applicable.
2991  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2992  Parameters:
2993  handle - A valid open-instance handle, returned from the driver's
2994  open routine
2995  clockSource - Clock source of the timer
2996  preScale - Timer's Prescaler divisor
2997  Returns:
2998  - true - if the operation is successful
2999  - false - either the handle is invalid or the clockSource
3000  and/or prescaler are not supported
3001  Example:
3002  <code>
3003  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3004  DRV_TMR_ClockSet ( tmrHandle, DRV_TMR_CLKSOURCE_INTERNAL, TMR_PRESCALE_VALUE_256 );
3005  </code>
3006  Remarks:
3007  None.
3008 */
3009 
3010 bool
3012  DRV_HANDLE handle ,
3013  DRV_TMR_CLK_SOURCES clockSource ,
3014  TMR_PRESCALE preScale ) ;
3015 // *****************************************************************************
3016 /* Function:
3017  TMR_PRESCALE DRV_TMR_PrescalerGet ( DRV_HANDLE handle )
3018  Summary:
3019  This function gets the currently selected prescaler.
3020  <p><b>Implementation:</b> Dynamic</p>
3021  Description:
3022  This function gets the currently selected prescaler.
3023  Precondition:
3024  The DRV_TMR_Initialize function must have been called.
3025  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3026  Parameters:
3027  handle - A valid open-instance handle, returned from the driver's
3028  open routine
3029  Returns:
3030  Timer prescaler.
3031  Example:
3032  <code>
3033  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3034  TMR_PRESCALE preScale;
3035  preScale = DRV_TMR_PrescalerGet ( tmrHandle );
3036  </code>
3037  Remarks:
3038  None.
3039 */
3040 
3041 TMR_PRESCALE
3043  DRV_HANDLE handle ) ;
3044 // *****************************************************************************
3045 /* Function:
3046  DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
3047  Summary:
3048  This function gets the currently selected operation mode.
3049  <p><b>Implementation:</b> Dynamic</p>
3050  Description:
3051  This function gets the currently selected 16/32 bit operation mode.
3052  Precondition:
3053  The DRV_TMR_Initialize function must have been called.
3054  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3055  Parameters:
3056  handle - A valid open-instance handle, returned from the driver's
3057  open routine
3058  Returns:
3059  A DRV_TMR_OPERATION_MODE value showing how the timer is currently
3060  configured. DRV_TMR_OPERATION_MODE_NONE is returned for an invalid client
3061  handle.
3062  Example:
3063  <code>
3064  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3065  DRV_TMR_OPERATION_MODE operMode;
3066  operMode = DRV_TMR_OperationModeGet ( tmrHandle );
3067  </code>
3068  Remarks:
3069  None.
3070 */
3071 
3074  DRV_HANDLE handle ) ;
3075 // *****************************************************************************
3076 /* Function:
3077  bool DRV_TMR_GateModeSet ( DRV_HANDLE handle )
3078  Summary:
3079  Enables the Gate mode.
3080  <p><b>Implementation:</b> Dynamic</p>
3081  Description:
3082  This function enables the Gated mode of Timer. User can measure the duration
3083  of an external signal in this mode. Once the Gate mode is enabled, Timer
3084  will start on the raising edge of the external signal. It will keep counting
3085  until the next falling edge.
3086  Precondition:
3087  The DRV_TMR_Initialize function must have been called.
3088  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3089  Parameters:
3090  handle - A valid open-instance handle, returned from the driver's
3091  open routine
3092  Returns:
3093  - true - if the operation is successful
3094  - false - either the handle is invalid or the gate mode
3095  is not supported
3096  Example:
3097  <code>
3098  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3099  DRV_TMR_GateModeSet ( tmrHandle );
3100  </code>
3101  Remarks:
3102  None.
3103 */
3104 
3105 bool
3107  DRV_HANDLE handle ) ;
3108 // *****************************************************************************
3109 /* Function:
3110  bool DRV_TMR_GateModeClear ( DRV_HANDLE handle )
3111  Summary:
3112  Enables the Gate mode.
3113  <p><b>Implementation:</b> Dynamic</p>
3114  Description:
3115  This function enables the Gated mode of Timer. User can measure the duration
3116  of an external signal in this mode. Once the Gate mode is enabled, Timer
3117  will start on the raising edge of the external signal. It will keep counting
3118  until the next falling edge.
3119  Precondition:
3120  The DRV_TMR_Initialize function must have been called.
3121  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3122  Parameters:
3123  handle - A valid open-instance handle, returned from the driver's
3124  open routine
3125  Returns:
3126  - true - if the operation is successful
3127  - false - either the handle is invalid or the gate mode
3128  is not supported
3129  Example:
3130  <code>
3131  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3132  DRV_TMR_GateModeClear ( tmrHandle );
3133  </code>
3134  Remarks:
3135  None.
3136 */
3137 
3138 bool
3140  DRV_HANDLE handle ) ;
3141 // *****************************************************************************
3142 /* Function:
3143  uint32_t DRV_TMR_CounterFrequencyGet ( DRV_HANDLE handle )
3144  Summary:
3145  Provides the Timer input frequency.
3146  <p><b>Implementation:</b> Dynamic</p>
3147  Description:
3148  This function provides the Timer input frequency. Input frequency is the
3149  clock to the Timer register and it is considering the prescaler divisor.
3150  Precondition:
3151  The DRV_TMR_Initialize function must have been called.
3152  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3153  Parameters:
3154  handle - A valid open-instance handle, returned from the driver's
3155  open routine
3156  Returns:
3157  32-bit value corresponding to the running frequency.
3158  If Timer clock source is external, then this function returns 0.
3159  Example:
3160  <code>
3161  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3162  uint32_t clkFreqHz;
3163  clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
3164  </code>
3165  Remarks:
3166  On most processors, the Timer's base frequency is the same as the peripheral
3167  bus clock.
3168 */
3169 
3170 uint32_t
3172  DRV_HANDLE handle ) ;
3173 // *****************************************************************************
3174 /* Function:
3175  DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet
3176  (
3177  DRV_HANDLE handle,
3178  DRV_TMR_DIVIDER_RANGE* pDivRange
3179  )
3180  Summary:
3181  Returns the Timer divider values.
3182  <p><b>Implementation:</b> Dynamic</p>
3183  Description:
3184  This function provides the Timer operating mode and divider range.
3185  Precondition:
3186  The DRV_TMR_Initialize function must have been called.
3187  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3188  Parameters:
3189  handle - A valid open-instance handle, returned from the driver's
3190  open routine
3191  pDivRange - Address to store the timer divider range.
3192  Returns:
3193  - A DRV_TMR_OPERATION_MODE value showing how the timer is currently configured.
3194  The pDivRange is updated with the supported range values.
3195  - DRV_TMR_OPERATION_MODE_NONE for invalid client handle
3196  Example:
3197  <code>
3198  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3199  DRV_TMR_OPERATION_MODE timerMode;
3200  DRV_TMR_DIVIDER_RANGE timerRange;
3201  DRV_TMR_DividerRangeGet(handle, &timerRange);
3202  uint32_t clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
3203  uint32_t maxFreqHz = clkFreqHz / timerRange.dividerMin;
3204  uint32_t minFreqHz = clkFreqHz / timerRange.dividerMax;
3205  </code>
3206  Remarks:
3207  None.
3208 */
3209 
3212  DRV_HANDLE handle ,
3213  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3214 // *****************************************************************************
3215 // *****************************************************************************
3216 // Section: File includes for the APIs which are required for backward
3217 // compatibility.
3218 // *****************************************************************************
3219 // *****************************************************************************
3220 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h */
3221 /*******************************************************************************
3222  Timer Device Driver Interface Definition
3223  Company:
3224  Microchip Technology Inc.
3225  File Name:
3226  drv_tmr_compatibility.h
3227  Summary:
3228  Timer device driver interface header file.
3229  Description:
3230  This header file contains macro definition for APIs which will be deprecated
3231  later. This header file is included in drv_tmr.h.
3232 *******************************************************************************/
3233 //DOM-IGNORE-BEGIN
3234 /*******************************************************************************
3235 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
3236 Microchip licenses to you the right to use, modify, copy and distribute
3237 Software only when embedded on a Microchip microcontroller or digital signal
3238 controller that is integrated into your product or third party product
3239 (pursuant to the sublicense terms in the accompanying license agreement).
3240 You should refer to the license agreement accompanying this Software for
3241 additional information regarding your rights and obligations.
3242 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
3243 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
3244 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
3245 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
3246 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
3247 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
3248 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
3249 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
3250 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
3251 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
3252 *******************************************************************************/
3253 //DOM-IGNORE-END
3254 #ifndef _DRV_TMR_DEPRECATED_H
3255 #define _DRV_TMR_DEPRECATED_H
3256 // *****************************************************************************
3257 // *****************************************************************************
3258 // Section: File includes
3259 // *****************************************************************************
3260 // *****************************************************************************
3261 // *****************************************************************************
3262 /* Function:
3263  void DRV_TMR_Tasks_ISR ( SYS_MODULE_OBJ object )
3264  Summary:
3265  Maintains the driver's state machine, processes the events and implements
3266  its ISR.
3267  <p><b>Implementation:</b> Dynamic</p>
3268  Description:
3269  This function is used to maintain the driver's internal state machine and
3270  processes the timer events in interrupt-driven implementations
3271  (DRV_TMR_INTERRUPT_MODE == true).
3272  Precondition:
3273  The DRV_TMR_Initialize function must have been called for the specified Timer
3274  driver instance.
3275  Parameters:
3276  object - Object handle for the specified driver instance (returned from
3277  DRV_TMR_Initialize)
3278  Returns:
3279  None
3280  Example:
3281  <code>
3282  void __ISR(_TIMER_2_VECTOR, ipl4) _InterruptHandler_TMR2(void)
3283  {
3284  DRV_TMR_Tasks_ISR(appDrvObjects.drvTmrObject);
3285  }
3286  </code>
3287  Remarks:
3288  This function is normally not called directly by an application.
3289  It is called by the timer driver raw ISR.
3290  This function will execute in an ISR context and will never block or access any
3291  resources that may cause it to block.
3292 
3293  This function will be deprecated later, so avoid using it as much as possible.
3294  Use generic function "DRV_TMR_Tasks" instead of this.
3295 */
3296 #define DRV_TMR_Tasks_ISR( object ) DRV_TMR_Tasks ( object )
3297 // *****************************************************************************
3298 /* Function:
3299  void DRV_TMR_CounterValue16BitSet
3300  (
3301  DRV_HANDLE handle,
3302  uint16_t counterPeriod
3303  )
3304  Summary:
3305  Updates the 16-bit Timer's counter register.
3306  <p><b>Implementation:</b> Dynamic</p>
3307  Description:
3308  This function updates the 16-bit Timer's value in the counter register. This
3309  is valid only if the 16-bit mode of the timer is selected('mode' in the INIT
3310  structure is set to DRV_TMR_OPERATION_MODE_16_BIT). Otherwise use
3311  DRV_TMR_CounterValue32BitSet function.
3312  Precondition:
3313  The DRV_TMR_Initialize function must have been called. Must have selected
3314  16-Bit timer mode if mode selection is applicable.
3315  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3316  Parameters:
3317  handle - A valid open-instance handle, returned from the driver's
3318  open routine
3319  counterPeriod - 16-bit counter period value
3320  Returns:
3321  None.
3322  Example:
3323  <code>
3324  //Example to use timer for precision time measurement
3325  //without configuring an alarm (interrupt based)
3326  char appState = 0;
3327  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3328 
3329  switch ( appState )
3330  {
3331  case 0:
3332  //Calculate and set the counter period
3333  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
3334 
3335  //counter starts
3336  DRV_TMR_Start ( tmrHandle );
3337 
3338  //Trigger an application operation
3339  app_trigger_operation();
3340 
3341  //Check for time-out in the next state
3342  appState++;
3343  case 1:
3344  //Overflows and stops at 0 if no alarm is set
3345  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3346  {
3347  //Time-out
3348  return false;
3349  }
3350  else if ( app_operation_isComplete( ) )
3351  {
3352  //Operation is complete before time-out
3353  return true;
3354  }
3355  </code>
3356  Remarks:
3357  This function will be deprecated later, so avoid using it as much as possible.
3358  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3359 */
3360 #define DRV_TMR_CounterValue16BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3361 // *****************************************************************************
3362 /* Function:
3363  void DRV_TMR_CounterValue32BitSet
3364  (
3365  DRV_HANDLE handle,
3366  uint32_t counterPeriod
3367  )
3368  Summary:
3369  Updates the 32-bit Timer's counter register.
3370  <p><b>Implementation:</b> Dynamic</p>
3371  Description:
3372  This function updates the 32-bit Timer's value in the counter register. This
3373  is valid only if the 32-bit mode of the timer is selected Otherwise use
3374  DRV_TMR_CounterValue16BitSet function.
3375  Precondition:
3376  The DRV_TMR_Initialize function must have been called. Must have selected
3377  32-Bit timer mode.
3378  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3379  Parameters:
3380  handle - A valid open-instance handle, returned from the driver's
3381  open routine
3382  counterPeriod - 32-bit counter period value
3383  Returns:
3384  None.
3385  Example:
3386  <code>
3387  //Example to use timer for precision time measurement
3388  //without configuring an alarm (interrupt based)
3389  char appState = 0;
3390  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3391 
3392  switch ( appState )
3393  {
3394  case 0:
3395  //Calculate and set the counter period
3396  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0xFF343100 ) );
3397 
3398  //counter starts
3399  DRV_TMR_Start ( tmrHandle );
3400 
3401  //Trigger an application operation against which we want to use the time-out
3402  app_trigger_operation();
3403 
3404  //Check for time-out in the next state
3405  appState++;
3406  case 1:
3407  //Overflows and stops at 0 if no alarm is set
3408  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3409  {
3410  //Time-out
3411  return false;
3412  }
3413  else if ( app_operation_isComplete( ) )
3414  {
3415  //Operation is complete before time-out
3416  return true;
3417  }
3418  </code>
3419  Remarks:
3420  In most of the devices only even numbered instances of timer supports
3421  32-bit mode.
3422  This function will be deprecated later, so avoid using it as much as possible.
3423  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3424 */
3425 #define DRV_TMR_CounterValue32BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3426 // *****************************************************************************
3427 /* Function:
3428  uint16_t DRV_TMR_CounterValue16BitGet ( DRV_HANDLE handle )
3429  Summary:
3430  Reads the 16-bit Timer's counter register.
3431  <p><b>Implementation:</b> Dynamic</p>
3432  Description:
3433  This function returns the 16-bit Timer's value in the counter register. This
3434  is valid only if the 16-bit mode of the timer is selected.
3435  Otherwise use DRV_TMR_CounterValue32BitGet function.
3436  Precondition:
3437  The DRV_TMR_Initialize function must have been called. Must have selected
3438  16-Bit timer mode if mode selection is applicable.
3439  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3440  Parameters:
3441  handle - A valid open-instance handle, returned from the driver's
3442  open routine
3443 
3444  Returns:
3445  Timer period in 16-bit mode.
3446  Example:
3447  <code>
3448  //Example to use timer for precision time measurement
3449  //without configuring an alarm (interrupt based)
3450  char appState = 0;
3451  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3452 
3453  switch ( appState )
3454  {
3455  case 0:
3456  //Calculate and set the counter period
3457  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
3458 
3459  //counter starts
3460  DRV_TMR_Start ( tmrHandle );
3461 
3462  //Trigger an application operation
3463  app_trigger_operation();
3464 
3465  //Check for time-out in the next state
3466  appState++;
3467  case 1:
3468  //Overflows and stops at 0 if no alarm is set
3469  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3470  {
3471  //Time-out
3472  return false;
3473  }
3474  else if ( app_operation_isComplete( ) )
3475  {
3476  //Operation is complete before time-out
3477  return true;
3478  }
3479  </code>
3480  Remarks:
3481  This function will be deprecated later, so avoid using it as much as possible.
3482  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3483 */
3484 #define DRV_TMR_CounterValue16BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3485 // *****************************************************************************
3486 /* Function:
3487  uint32_t DRV_TMR_CounterValue32BitGet ( DRV_HANDLE handle )
3488  Summary:
3489  Reads the 32-bit Timer's counter register.
3490  <p><b>Implementation:</b> Dynamic</p>
3491  Description:
3492  This function returns the 32-bit Timer's value in the counter register. This
3493  is valid only if the 32-bit mode of the timer is selected Otherwise use
3494  DRV_TMR_CounterValue16BitGet function.
3495  Precondition:
3496  The DRV_TMR_Initialize function must have been called. Must have selected
3497  32-Bit timer mode.
3498  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3499  Parameters:
3500  handle - A valid open-instance handle, returned from the driver's
3501  open routine
3502 
3503  Returns:
3504  32-Bit Counter value.
3505  Example:
3506  <code>
3507  //Example to use timer for precision time measurement
3508  //without configuring an alarm (interrupt based)
3509  char appState = 0;
3510  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3511 
3512  switch ( appState )
3513  {
3514  case 0:
3515  //Calculate and set the counter period
3516  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0x23321000 ) );
3517 
3518  //counter starts
3519  DRV_TMR_Start ( tmrHandle );
3520 
3521  //Trigger an application operation
3522  app_trigger_operation();
3523 
3524  //Check for time-out in the next state
3525  appState++;
3526  case 1:
3527  //Overflows and stops at 0 if no alarm is set
3528  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3529  {
3530  //Time-out
3531  return false;
3532  }
3533  else if ( app_operation_isComplete( ) )
3534  {
3535  //Operation is complete before time-out
3536  return true;
3537  }
3538  </code>
3539  Remarks:
3540  In most of the devices only even numbered instances of timer supports
3541  32-bit mode.
3542  This function will be deprecated later, so avoid using it as much as possible.
3543  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3544 */
3545 #define DRV_TMR_CounterValue32BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3546 // *****************************************************************************
3547 /* Function:
3548  void DRV_TMR_Alarm16BitRegister
3549  (
3550  DRV_HANDLE handle,
3551  uint16_t period,
3552  bool isPeriodic,
3553  uintptr_t context,
3554  DRV_TMR_CALLBACK callBack
3555  )
3556  Summary:
3557  Sets up an alarm.
3558  <p><b>Implementation:</b> Dynamic</p>
3559  Description:
3560  This function sets up an alarm, allowing the client to receive a callback
3561  from the driver when the counter period elapses. Alarms can be one-shot or
3562  periodic. This API is valid only if the 16-bit mode of the timer is
3563  selected. Otherwise use DRV_TMR_Alarm32BitRegister function.
3564  Precondition:
3565  The DRV_TMR_Initialize function must have been called. Must have selected
3566  16-Bit timer mode if mode selection is applicable.
3567  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3568  Parameters:
3569  handle - A valid handle, returned from DRV_TMR_Open
3570  period - 16-bit period which will be loaded into the Timer hardware register.
3571 
3572  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3573 
3574  context - A reference, call back function will be called with the same
3575  reference.
3576 
3577  callBack - A call back function which will be called on period elapse.
3578 
3579  Returns:
3580  None
3581  Example:
3582  <code>
3583  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3584 
3585  void setupTask ()
3586  {
3587  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3588 
3589  // Calculate the count to be passed on from the clock input
3590  //Periodically toggle LED
3591  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF40, true, 0,
3592  ToggleLedCallBack );
3593  }
3594 
3595  void ToggleLedCallBack ( uintptr_t context )
3596  {
3597  //Toggle
3598  }
3599  </code>
3600  Remarks:
3601  This function will be deprecated later, so avoid using it as much as possible.
3602  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3603 */
3604 #define DRV_TMR_Alarm16BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3605 // *****************************************************************************
3606 /* Function:
3607  void DRV_TMR_Alarm32BitRegister
3608  (
3609  DRV_HANDLE handle,
3610  uint32_t period,
3611  bool isPeriodic,
3612  uintptr_t context,
3613  DRV_TMR_CALLBACK callBack
3614  )
3615  Summary:
3616  Sets up an alarm.
3617  <p><b>Implementation:</b> Dynamic</p>
3618  Description:
3619  This function sets up an alarm, allowing the client to receive a callback
3620  from the driver when the counter period elapses. Alarms can be one-shot or
3621  periodic. This API is valid only if the 32-bit mode of the timer is
3622  selected Otherwise use DRV_TMR_Alarm16BitRegister function.
3623  Precondition:
3624  The DRV_TMR_Initialize function must have been called. Must have selected
3625  32-Bit timer mode.
3626  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3627  Parameters:
3628  handle - A valid handle, returned from DRV_TMR_Open
3629  period - 32-bit period which will be loaded into the Timer hardware register.
3630 
3631  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3632 
3633  context - A reference, call back function will be called with the same
3634  reference.
3635 
3636  callBack - A call back function which will be called on period elapse.
3637 
3638  Returns:
3639  None
3640  Example:
3641  <code>
3642  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3643 
3644  void setupTask ()
3645  {
3646  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3647 
3648  // Calculate the count to be passed on from the clock input
3649  //Periodically toggle LED
3650  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFFFFFF00, true, 0,
3651  ToggleLedCallBack );
3652  }
3653 
3654  void ToggleLedCallBack ( uintptr_t context )
3655  {
3656  //Toggle
3657  }
3658  </code>
3659  Remarks:
3660  In most of the devices only even numbered instances of timer supports
3661  32-bit mode.
3662  This function will be deprecated later, so avoid using it as much as possible.
3663  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3664 */
3665 #define DRV_TMR_Alarm32BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3666 // *****************************************************************************
3667 /* Function:
3668  void DRV_TMR_AlarmPeriod16BitSet ( DRV_HANDLE handle, uint16_t value )
3669  Summary:
3670  Updates the 16-bit Timer's period.
3671  <p><b>Implementation:</b> Dynamic</p>
3672  Description:
3673  This function updates the 16-bit Timer's period. This API is valid only if
3674  the 16-bit mode of the timer is selected
3675  Otherwise use DRV_TMR_AlarmPeriod32BitSet function.
3676  Precondition:
3677  The DRV_TMR_Initialize function must have been called. Must have selected
3678  16-Bit timer mode if mode selection is applicable.
3679  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3680  Parameters:
3681  handle - A valid open-instance handle, returned from the driver's
3682  open routine
3683  value - 16-bit Period value
3684  Returns:
3685  None.
3686  Example:
3687  <code>
3688  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3689  DRV_TMR_AlarmPeriod16BitSet ( handle, 0x1000 );
3690  </code>
3691  Remarks:
3692  This function will be deprecated later, so avoid using it as much as possible.
3693  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3694 */
3695 #define DRV_TMR_AlarmPeriod16BitSet( handle , value ) DRV_TMR_AlarmPeriodSet ( handle , value )
3696 // *****************************************************************************
3697 /* Function:
3698  void DRV_TMR_AlarmPeriod32BitSet ( DRV_HANDLE handle, uint32_t period )
3699  Summary:
3700  Updates the 32-bit Timer's period.
3701  <p><b>Implementation:</b> Dynamic</p>
3702  Description:
3703  This function updates the 32-bit Timer's period. This API is valid only if
3704  the 32-bit mode of the timer is selected
3705  Otherwise use DRV_TMR_AlarmPeriod16BitSet function.
3706  Precondition:
3707  The DRV_TMR_Initialize unction must have been called. Must have selected
3708  32-Bit timer mode.
3709  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3710  Parameters:
3711  handle - A valid open-instance handle, returned from the driver's
3712  open routine
3713  period - 32-bit Period value
3714  Returns:
3715  None.
3716  Example:
3717  <code>
3718  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3719  DRV_TMR_AlarmPeriod32BitSet ( handle, 0xFFFFFF00 );
3720  </code>
3721  Remarks:
3722  In most of the devices only even numbered instances of timer supports
3723  32-bit mode.
3724  This function will be deprecated later, so avoid using it as much as possible.
3725  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3726 */
3727 #define DRV_TMR_AlarmPeriod32BitSet( handle , period ) DRV_TMR_AlarmPeriodSet ( handle , period )
3728 // *****************************************************************************
3729 /* Function:
3730  uint16_t DRV_TMR_AlarmPeriod16BitGet ( DRV_HANDLE handle )
3731  Summary:
3732  Provides the 16-bit Timer's period.
3733  <p><b>Implementation:</b> Dynamic</p>
3734  Description:
3735  This function gets the 16-bit Timer's period. This API is valid only if
3736  the 16-bit mode of the timer is selected.
3737  Otherwise use DRV_TMR_AlarmPeriod32BitGet function.
3738  Precondition:
3739  The DRV_TMR_Initialize function must have been called. Must have selected
3740  16-Bit timer mode if mode selection is applicable.
3741  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3742  Parameters:
3743  handle - A valid open-instance handle, returned from the driver's
3744  open routine
3745  Returns:
3746  16-bit timer period value
3747  Example:
3748  <code>
3749  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3750  uint16_t period;
3751 
3752  period = DRV_TMR_AlarmPeriod16BitGet ( tmrHandle );
3753  </code>
3754  Remarks:
3755  This function will be deprecated later, so avoid using it as much as possible.
3756  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3757 */
3758 #define DRV_TMR_AlarmPeriod16BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3759 // *****************************************************************************
3760 /* Function:
3761  uint32_t DRV_TMR_AlarmPeriod32BitGet ( DRV_HANDLE handle )
3762  Summary:
3763  Provides the 32-bit Timer's period.
3764  <p><b>Implementation:</b> Dynamic</p>
3765  Description:
3766  This function gets the 32-bit Timer's period. This API is valid only if
3767  the 32-bit mode of the timer is selected
3768  Otherwise use DRV_TMR_AlarmPeriod16BitGet function.
3769  Precondition:
3770  The DRV_TMR_Initialize function must have been called. Must have selected
3771  32-Bit timer mode.
3772  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3773  Parameters:
3774  handle - A valid open-instance handle, returned from the driver's
3775  open routine
3776  Returns:
3777  32-bit Timer period value.
3778  Example:
3779  <code>
3780  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3781  uint32_t period;
3782  period = DRV_TMR_AlarmPeriod32BitGet ( handle );
3783  </code>
3784  Remarks:
3785  In most of the devices only even numbered instances of timer supports
3786  32-bit mode.
3787  This function will be deprecated later, so avoid using it as much as possible.
3788  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3789 */
3790 #define DRV_TMR_AlarmPeriod32BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3791 // *****************************************************************************
3792 /* Function:
3793  void DRV_TMR_Alarm16BitDeregister ( DRV_HANDLE handle )
3794  Summary:
3795  Removes a previously set alarm.
3796  <p><b>Implementation:</b> Dynamic</p>
3797  Description:
3798  This function removes a previously set alarm. This API is valid only if
3799  the 16-bit mode of the timer is selected
3800  Otherwise use DRV_TMR_Alarm32BitDeregister function.
3801  Precondition:
3802  The DRV_TMR_Initialize function must have been called. Must have selected
3803  16-Bit timer mode if mode selection is applicable.
3804  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3805 
3806  DRV_TMR_Alarm16BitRegister function must have been called before.
3807  Parameters:
3808  handle - A valid open-instance handle, returned from the driver's
3809  open routine
3810  Returns:
3811  None.
3812  Example:
3813  <code>
3814  //Example of a key debounce check
3815 
3816  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3817  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3818  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3819 
3820  void keyPressDetect ()
3821  {
3822  // Calculate the count to be passed on from the clock input
3823  //Periodically toggle LED
3824  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF00, true,
3825  DebounceCheck );
3826  }
3827 
3828  void DebounceCheck ( uintptr_t context )
3829  {
3830  readKey = AppReadKey();
3831 
3832  if ( readKey != lastReadKey )
3833  {
3834  lastReadKey = readKey;
3835  keyCount = 0;
3836  }
3837  else
3838  {
3839  if ( keyCount > 20 )
3840  {
3841  globalKeyState = readKey;
3842  DRV_TMR_Alarm16BitDeregister ( tmrHandle );
3843  }
3844  keyCount++;
3845  }
3846  }
3847  </code>
3848  Remarks:
3849  This function will be deprecated later, so avoid using it as much as possible.
3850  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3851 */
3852 #define DRV_TMR_Alarm16BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3853 // *****************************************************************************
3854 /* Function:
3855  void DRV_TMR_Alarm32BitDeregister ( DRV_HANDLE handle )
3856  Summary:
3857  Removes a previously set alarm.
3858  <p><b>Implementation:</b> Dynamic</p>
3859  Description:
3860  This function removes a previously set alarm. This API is valid only if
3861  the 32-bit mode of the timer is selected
3862  Otherwise use DRV_TMR_Alarm16BitDeregister function.
3863  Precondition:
3864  The DRV_TMR_Initialize function must have been called. Must have selected
3865  32-Bit timer mode if mode selection is applicable.
3866  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3867 
3868  DRV_TMR_Alarm32BitRegister function must have been called before.
3869  Parameters:
3870  handle - A valid open-instance handle, returned from the driver's
3871  open routine
3872  Returns:
3873  None.
3874  Example:
3875  <code>
3876  //Example of a key debounce check
3877 
3878  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3879  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3880  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3881 
3882  void keyPressDetect ( void )
3883  {
3884  // Calculate the count to be passed on from the clock input
3885  //Periodically check the key status
3886  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFF0FFD20, true, 0,
3887  DebounceCheck );
3888  }
3889 
3890  void DebounceCheck ( uintptr_t context )
3891  {
3892  readKey = AppReadKey();
3893 
3894  if ( readKey != lastReadKey )
3895  {
3896  lastReadKey = readKey;
3897  keyCount = 0;
3898  }
3899  else
3900  {
3901  if ( keyCount > 20 )
3902  {
3903  //Key is stable now
3904  globalKeyState = readKey;
3905  DRV_TMR_Alarm32BitDeregister ( tmrHandle );
3906  }
3907  keyCount++;
3908  }
3909  }
3910  </code>
3911  Remarks:
3912  In most of the devices only even numbered instances of timer supports
3913  32-bit mode.
3914  This function will be deprecated later, so avoid using it as much as possible.
3915  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3916 */
3917 #define DRV_TMR_Alarm32BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3918  // #ifndef _DRV_TMR_DEPRECATED_H
3919 /*******************************************************************************
3920  End of File
3921 */
3922 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h*/
3923 /* CLOSE_FILE Include File */
3924 
3925 //DOM-IGNORE-BEGIN
3926 //DOM-IGNORE-END
3927  // #ifndef _DRV_TMR_H
3928 /*******************************************************************************
3929  End of File
3930 */
3931 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h*/
3932 /* CLOSE_FILE Include File */
3933 
3934 #include "peripheral/tmr/plib_tmr.h"
3935 #include "peripheral/int/plib_int.h"
3936 // maximum divider value for 32 bit operation mode
3937 #define DRV_TIMER_DIVIDER_MAX_32BIT 0xffffffff
3938 // minimum divider value for 32 bit operation mode
3939 #define DRV_TIMER_DIVIDER_MIN_32BIT 0x2
3940 // maximum divider value for 16 bit operation mode
3941 #define DRV_TIMER_DIVIDER_MAX_16BIT 0x10000
3942 // minimum divider value for 16 bit operation mode
3943 #define DRV_TIMER_DIVIDER_MIN_16BIT 0x2
3944 // *****************************************************************************
3945 // *****************************************************************************
3946 // Section: Interface Headers for Instance 0 for the static driver
3947 // *****************************************************************************
3948 // *****************************************************************************
3949 
3950 void
3951  DRV_TMR0_Initialize ( void ) ;
3952 
3953 bool
3954  DRV_TMR0_Start ( void ) ;
3955 
3956 void
3957  DRV_TMR0_Stop ( void ) ;
3958 
3959 static inline void
3961  {
3962  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 0))); /* 37 */
3963  DRV_TMR0_Stop () ;
3964  ((int)(bitmapstruct.element0 |= (1 << 1))); /* 30 */
3965  switches_57zqendz ( 2 ) ; /* 30 */
3966  }
3967 
3968 static inline SYS_STATUS
3970 {
3971  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 2))); /* 37 */
3972  /* Return the status as ready always */
3973  ((int)(bitmapstruct.element0 |= (1 << 3))); /* 30 */
3974  switches_57zqendz ( 4 ) ; /* 30 */
3975  return
3976  SYS_STATUS_READY ;
3977 }
3978 
3979 static inline void
3980  DRV_TMR0_Open ( void )
3981  {
3982  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 4))); /* 37 */
3983  ((int)(bitmapstruct.element0 |= (1 << 5))); /* 30 */
3984  switches_57zqendz ( 6 ) ; /* 30 */
3985  }
3986 
3988  DRV_TMR0_ClientStatus ( void ) ;
3989 
3990 static inline DRV_TMR_OPERATION_MODE
3992 {
3993  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 6))); /* 37 */
3994  ((int)(bitmapstruct.element0 |= (1 << 7))); /* 30 */
3995  switches_57zqendz ( 8 ) ; /* 30 */
3996  return
3998 }
3999 
4000 static inline void
4002  {
4003  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 8))); /* 37 */
4004  DRV_TMR0_Stop () ;
4005  ((int)(bitmapstruct.element0 |= (1 << 9))); /* 30 */
4006  switches_57zqendz ( 10 ) ; /* 30 */
4007  }
4008 
4009 bool
4011  DRV_TMR_CLK_SOURCES clockSource ,
4012  TMR_PRESCALE prescale ) ;
4013 
4014 void
4016  uint32_t value ) ;
4017 
4018 uint32_t
4019  DRV_TMR0_CounterValueGet ( void ) ;
4020 
4021 void
4022  DRV_TMR0_CounterClear ( void ) ;
4023 
4024 TMR_PRESCALE
4025  DRV_TMR0_PrescalerGet ( void ) ;
4026 
4027 void
4029  uint32_t value ) ;
4030 
4031 uint32_t
4032  DRV_TMR0_PeriodValueGet ( void ) ;
4033 
4034 void
4035  DRV_TMR0_StopInIdleDisable ( void ) ;
4036 
4037 void
4038  DRV_TMR0_StopInIdleEnable ( void ) ;
4039 
4040 static inline void
4042  {
4043  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 10))); /* 37 */
4044  ((int)(bitmapstruct.element0 |= (1 << 11))); /* 30 */
4045  switches_57zqendz ( 12 ) ; /* 30 */
4046  }
4047 
4048 uint32_t
4049  DRV_TMR0_CounterFrequencyGet ( void ) ;
4050 
4053  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4054 // *****************************************************************************
4055 // *****************************************************************************
4056 // Section: Interface Headers for Instance 1 for the static driver
4057 // *****************************************************************************
4058 // *****************************************************************************
4059 
4060 void
4061  DRV_TMR1_Initialize ( void ) ;
4062 
4063 bool
4064  DRV_TMR1_Start ( void ) ;
4065 
4066 void
4067  DRV_TMR1_Stop ( void ) ;
4068 
4069 static inline void
4071  {
4072  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 12))); /* 37 */
4073  DRV_TMR1_Stop () ;
4074  ((int)(bitmapstruct.element0 |= (1 << 13))); /* 30 */
4075  switches_57zqendz ( 14 ) ; /* 30 */
4076  }
4077 
4078 static inline SYS_STATUS
4080 {
4081  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 14))); /* 37 */
4082  /* Return the status as ready always */
4083  ((int)(bitmapstruct.element0 |= (1 << 15))); /* 30 */
4084  switches_57zqendz ( 16 ) ; /* 30 */
4085  return
4086  SYS_STATUS_READY ;
4087 }
4088 
4089 static inline void
4090  DRV_TMR1_Open ( void )
4091  {
4092  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 16))); /* 37 */
4093  ((int)(bitmapstruct.element0 |= (1 << 17))); /* 30 */
4094  switches_57zqendz ( 18 ) ; /* 30 */
4095  }
4096 
4098  DRV_TMR1_ClientStatus ( void ) ;
4099 
4100 static inline DRV_TMR_OPERATION_MODE
4102 {
4103  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 18))); /* 37 */
4104  ((int)(bitmapstruct.element0 |= (1 << 19))); /* 30 */
4105  switches_57zqendz ( 20 ) ; /* 30 */
4106  return
4108 }
4109 
4110 static inline void
4112  {
4113  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 20))); /* 37 */
4114  DRV_TMR1_Stop () ;
4115  ((int)(bitmapstruct.element0 |= (1 << 21))); /* 30 */
4116  switches_57zqendz ( 22 ) ; /* 30 */
4117  }
4118 
4119 bool
4121  DRV_TMR_CLK_SOURCES clockSource ,
4122  TMR_PRESCALE prescale ) ;
4123 
4124 void
4126  uint32_t value ) ;
4127 
4128 uint32_t
4129  DRV_TMR1_CounterValueGet ( void ) ;
4130 
4131 void
4132  DRV_TMR1_CounterClear ( void ) ;
4133 
4134 TMR_PRESCALE
4135  DRV_TMR1_PrescalerGet ( void ) ;
4136 
4137 void
4139  uint32_t value ) ;
4140 
4141 uint32_t
4142  DRV_TMR1_PeriodValueGet ( void ) ;
4143 
4144 void
4145  DRV_TMR1_StopInIdleDisable ( void ) ;
4146 
4147 void
4148  DRV_TMR1_StopInIdleEnable ( void ) ;
4149 
4150 static inline void
4152  {
4153  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 22))); /* 37 */
4154  ((int)(bitmapstruct.element0 |= (1 << 23))); /* 30 */
4155  switches_57zqendz ( 24 ) ; /* 30 */
4156  }
4157 
4158 uint32_t
4159  DRV_TMR1_CounterFrequencyGet ( void ) ;
4160 
4163  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4164 // *****************************************************************************
4165 // *****************************************************************************
4166 // Section: Interface Headers for Instance 2 for the static driver
4167 // *****************************************************************************
4168 // *****************************************************************************
4169 
4170 void
4171  DRV_TMR2_Initialize ( void ) ;
4172 
4173 bool
4174  DRV_TMR2_Start ( void ) ;
4175 
4176 void
4177  DRV_TMR2_Stop ( void ) ;
4178 
4179 static inline void
4181  {
4182  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 24))); /* 37 */
4183  DRV_TMR2_Stop () ;
4184  ((int)(bitmapstruct.element0 |= (1 << 25))); /* 30 */
4185  switches_57zqendz ( 26 ) ; /* 30 */
4186  }
4187 
4188 static inline SYS_STATUS
4190 {
4191  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 26))); /* 37 */
4192  /* Return the status as ready always */
4193  ((int)(bitmapstruct.element0 |= (1 << 27))); /* 30 */
4194  switches_57zqendz ( 28 ) ; /* 30 */
4195  return
4196  SYS_STATUS_READY ;
4197 }
4198 
4199 static inline void
4200  DRV_TMR2_Open ( void )
4201  {
4202  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 28))); /* 37 */
4203  ((int)(bitmapstruct.element0 |= (1 << 29))); /* 30 */
4204  switches_57zqendz ( 30 ) ; /* 30 */
4205  }
4206 
4208  DRV_TMR2_ClientStatus ( void ) ;
4209 
4210 static inline DRV_TMR_OPERATION_MODE
4212 {
4213  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 30))); /* 37 */
4214  ((int)(bitmapstruct.element0 |= (1 << 31))); /* 30 */
4215  switches_57zqendz ( 32 ) ; /* 30 */
4216  return
4218 }
4219 
4220 static inline void
4222  {
4223  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 0))); /* 37 */
4224  DRV_TMR2_Stop () ;
4225  ((int)(bitmapstruct.element1 |= (1 << 1))); /* 30 */
4226  switches_57zqendz ( 34 ) ; /* 30 */
4227  }
4228 
4229 bool
4231  DRV_TMR_CLK_SOURCES clockSource ,
4232  TMR_PRESCALE prescale ) ;
4233 
4234 void
4236  uint32_t value ) ;
4237 
4238 uint32_t
4239  DRV_TMR2_CounterValueGet ( void ) ;
4240 
4241 void
4242  DRV_TMR2_CounterClear ( void ) ;
4243 
4244 TMR_PRESCALE
4245  DRV_TMR2_PrescalerGet ( void ) ;
4246 
4247 void
4249  uint32_t value ) ;
4250 
4251 uint32_t
4252  DRV_TMR2_PeriodValueGet ( void ) ;
4253 
4254 void
4255  DRV_TMR2_StopInIdleDisable ( void ) ;
4256 
4257 void
4258  DRV_TMR2_StopInIdleEnable ( void ) ;
4259 
4260 static inline void
4262  {
4263  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 2))); /* 37 */
4264  ((int)(bitmapstruct.element1 |= (1 << 3))); /* 30 */
4265  switches_57zqendz ( 36 ) ; /* 30 */
4266  }
4267 
4268 uint32_t
4269  DRV_TMR2_CounterFrequencyGet ( void ) ;
4270 
4273  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4274 // *****************************************************************************
4275 // *****************************************************************************
4276 // Section: Interface Headers for Instance 3 for the static driver
4277 // *****************************************************************************
4278 // *****************************************************************************
4279 
4280 void
4281  DRV_TMR3_Initialize ( void ) ;
4282 
4283 bool
4284  DRV_TMR3_Start ( void ) ;
4285 
4286 void
4287  DRV_TMR3_Stop ( void ) ;
4288 
4289 static inline void
4291  {
4292  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 4))); /* 37 */
4293  DRV_TMR3_Stop () ;
4294  ((int)(bitmapstruct.element1 |= (1 << 5))); /* 30 */
4295  switches_57zqendz ( 38 ) ; /* 30 */
4296  }
4297 
4298 static inline SYS_STATUS
4300 {
4301  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 6))); /* 37 */
4302  /* Return the status as ready always */
4303  ((int)(bitmapstruct.element1 |= (1 << 7))); /* 30 */
4304  switches_57zqendz ( 40 ) ; /* 30 */
4305  return
4306  SYS_STATUS_READY ;
4307 }
4308 
4309 static inline void
4310  DRV_TMR3_Open ( void )
4311  {
4312  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 8))); /* 37 */
4313  ((int)(bitmapstruct.element1 |= (1 << 9))); /* 30 */
4314  switches_57zqendz ( 42 ) ; /* 30 */
4315  }
4316 
4318  DRV_TMR3_ClientStatus ( void ) ;
4319 
4320 static inline DRV_TMR_OPERATION_MODE
4322 {
4323  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 10))); /* 37 */
4324  ((int)(bitmapstruct.element1 |= (1 << 11))); /* 30 */
4325  switches_57zqendz ( 44 ) ; /* 30 */
4326  return
4328 }
4329 
4330 static inline void
4332  {
4333  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 12))); /* 37 */
4334  DRV_TMR3_Stop () ;
4335  ((int)(bitmapstruct.element1 |= (1 << 13))); /* 30 */
4336  switches_57zqendz ( 46 ) ; /* 30 */
4337  }
4338 
4339 bool
4341  DRV_TMR_CLK_SOURCES clockSource ,
4342  TMR_PRESCALE prescale ) ;
4343 
4344 void
4346  uint32_t value ) ;
4347 
4348 uint32_t
4349  DRV_TMR3_CounterValueGet ( void ) ;
4350 
4351 void
4352  DRV_TMR3_CounterClear ( void ) ;
4353 
4354 TMR_PRESCALE
4355  DRV_TMR3_PrescalerGet ( void ) ;
4356 
4357 void
4359  uint32_t value ) ;
4360 
4361 uint32_t
4362  DRV_TMR3_PeriodValueGet ( void ) ;
4363 
4364 void
4365  DRV_TMR3_StopInIdleDisable ( void ) ;
4366 
4367 void
4368  DRV_TMR3_StopInIdleEnable ( void ) ;
4369 
4370 static inline void
4372  {
4373  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 14))); /* 37 */
4374  ((int)(bitmapstruct.element1 |= (1 << 15))); /* 30 */
4375  switches_57zqendz ( 48 ) ; /* 30 */
4376  }
4377 
4378 uint32_t
4379  DRV_TMR3_CounterFrequencyGet ( void ) ;
4380 
4383  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4384 // *****************************************************************************
4385 // *****************************************************************************
4386 // Section: Interface Headers for Instance 4 for the static driver
4387 // *****************************************************************************
4388 // *****************************************************************************
4389 
4390 void
4391  DRV_TMR4_Initialize ( void ) ;
4392 
4393 bool
4394  DRV_TMR4_Start ( void ) ;
4395 
4396 void
4397  DRV_TMR4_Stop ( void ) ;
4398 
4399 static inline void
4401  {
4402  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 16))); /* 37 */
4403  DRV_TMR4_Stop () ;
4404  ((int)(bitmapstruct.element1 |= (1 << 17))); /* 30 */
4405  switches_57zqendz ( 50 ) ; /* 30 */
4406  }
4407 
4408 static inline SYS_STATUS
4410 {
4411  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 18))); /* 37 */
4412  /* Return the status as ready always */
4413  ((int)(bitmapstruct.element1 |= (1 << 19))); /* 30 */
4414  switches_57zqendz ( 52 ) ; /* 30 */
4415  return
4416  SYS_STATUS_READY ;
4417 }
4418 
4419 static inline void
4420  DRV_TMR4_Open ( void )
4421  {
4422  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 20))); /* 37 */
4423  ((int)(bitmapstruct.element1 |= (1 << 21))); /* 30 */
4424  switches_57zqendz ( 54 ) ; /* 30 */
4425  }
4426 
4428  DRV_TMR4_ClientStatus ( void ) ;
4429 
4430 static inline DRV_TMR_OPERATION_MODE
4432 {
4433  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 22))); /* 37 */
4434  ((int)(bitmapstruct.element1 |= (1 << 23))); /* 30 */
4435  switches_57zqendz ( 56 ) ; /* 30 */
4436  return
4438 }
4439 
4440 static inline void
4442  {
4443  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 24))); /* 37 */
4444  DRV_TMR4_Stop () ;
4445  ((int)(bitmapstruct.element1 |= (1 << 25))); /* 30 */
4446  switches_57zqendz ( 58 ) ; /* 30 */
4447  }
4448 
4449 bool
4451  DRV_TMR_CLK_SOURCES clockSource ,
4452  TMR_PRESCALE prescale ) ;
4453 
4454 void
4456  uint32_t value ) ;
4457 
4458 uint32_t
4459  DRV_TMR4_CounterValueGet ( void ) ;
4460 
4461 void
4462  DRV_TMR4_CounterClear ( void ) ;
4463 
4464 TMR_PRESCALE
4465  DRV_TMR4_PrescalerGet ( void ) ;
4466 
4467 void
4469  uint32_t value ) ;
4470 
4471 uint32_t
4472  DRV_TMR4_PeriodValueGet ( void ) ;
4473 
4474 void
4475  DRV_TMR4_StopInIdleDisable ( void ) ;
4476 
4477 void
4478  DRV_TMR4_StopInIdleEnable ( void ) ;
4479 
4480 static inline void
4482  {
4483  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 26))); /* 37 */
4484  ((int)(bitmapstruct.element1 |= (1 << 27))); /* 30 */
4485  switches_57zqendz ( 60 ) ; /* 30 */
4486  }
4487 
4488 uint32_t
4489  DRV_TMR4_CounterFrequencyGet ( void ) ;
4490 
4493  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4494  // #ifndef _DRV_TMR_STATIC_H
4495 /*******************************************************************************
4496  End of File
4497 */
4498 
4499 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h*/
4500 /* CLOSE_FILE Include File */
4501 
4502 #include "peripheral/int/plib_int.h"
4503 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h */
4504 /*******************************************************************************
4505  PMP Driver Interface Declarations for Static Single Instance Driver
4506  Company:
4507  Microchip Technology Inc.
4508  File Name:
4509  drv_pmp_static.h
4510  Summary:
4511  PMP driver interface declarations for the static single instance driver.
4512  Description:
4513  The PMP device driver provides a simple interface to manage the PMP
4514  modules on Microchip microcontrollers. This file defines the interface
4515  Declarations for the PMP driver.
4516 
4517  Remarks:
4518  Static interfaces incorporate the driver instance number within the names
4519  of the routines, eliminating the need for an object ID or object handle.
4520 
4521  Static single-open interfaces also eliminate the need for the open handle.
4522 *******************************************************************************/
4523 //DOM-IGNORE-BEGIN
4524 /*******************************************************************************
4525 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
4526 Microchip licenses to you the right to use, modify, copy and distribute
4527 Software only when embedded on a Microchip microcontroller or digital signal
4528 controller that is integrated into your product or third party product
4529 (pursuant to the sublicense terms in the accompanying license agreement).
4530 You should refer to the license agreement accompanying this Software for
4531 additional information regarding your rights and obligations.
4532 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4533 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4534 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4535 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4536 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4537 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4538 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4539 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4540 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4541 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4542 *******************************************************************************/
4543 //DOM-IGNORE-END
4544 #ifndef _DRV_PMP_STATIC_H
4545 #define _DRV_PMP_STATIC_H
4546 #include "peripheral/pmp/plib_pmp.h"
4547 // *****************************************************************************
4548 // *****************************************************************************
4549 // Section: Interface Headers for Instance 0 for the static driver
4550 // *****************************************************************************
4551 // *****************************************************************************
4552 
4553 void
4554  DRV_PMP0_Initialize ( void ) ;
4555 
4556 void
4557  DRV_PMP0_ModeConfig ( void ) ;
4558 
4559 void
4561  PMP_DATA_WAIT_STATES dataWait ,
4562  PMP_STROBE_WAIT_STATES strobeWait ,
4563  PMP_DATA_HOLD_STATES dataHold ) ;
4564 
4565 uint8_t
4566  DRV_PMP0_Read ( void ) ;
4567 
4568 void
4569  DRV_PMP0_Write (
4570  uint8_t data ) ;
4571  // #ifndef _DRV_PMP_STATIC_H
4572 /*******************************************************************************
4573  End of File
4574 */
4575 
4576 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h*/
4577 /* CLOSE_FILE Include File */
4578 
4579 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h */
4580 /*******************************************************************************
4581  USART Driver Interface Declarations for Static Single Instance Driver
4582  Company:
4583  Microchip Technology Inc.
4584  File Name:
4585  drv_usart_static.h
4586  Summary:
4587  USART driver interface declarations for the static single instance driver.
4588  Description:
4589  The USART device driver provides a simple interface to manage the USART
4590  modules on Microchip microcontrollers. This file defines the interface
4591  Declarations for the USART static driver.
4592  Remarks:
4593  Static interfaces incorporate the driver instance number within the names
4594  of the routines, eliminating the need for an object ID or object handle.
4595  Static single-open interfaces also eliminate the need for the open handle.
4596 *******************************************************************************/
4597 //DOM-IGNORE-BEGIN
4598 /*******************************************************************************
4599 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4600 Microchip licenses to you the right to use, modify, copy and distribute
4601 Software only when embedded on a Microchip microcontroller or digital signal
4602 controller that is integrated into your product or third party product
4603 (pursuant to the sublicense terms in the accompanying license agreement).
4604 You should refer to the license agreement accompanying this Software for
4605 additional information regarding your rights and obligations.
4606 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4607 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4608 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4609 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4610 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4611 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4612 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4613 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4614 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4615 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4616 *******************************************************************************/
4617 //DOM-IGNORE-END
4618 #ifndef _DRV_USART_STATIC_H
4619 #define _DRV_USART_STATIC_H
4620 // *****************************************************************************
4621 // *****************************************************************************
4622 // Section: Included Files
4623 // *****************************************************************************
4624 // *****************************************************************************
4625 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h */
4626 /*******************************************************************************
4627  USART Driver Local Data Structures for static implementation
4628  Company:
4629  Microchip Technology Inc.
4630  File Name:
4631  drv_usart_static_local.h
4632  Summary:
4633  USART Driver Local Data Structures for static implementation
4634  Description:
4635  Driver Local Data Structures for static implementation
4636 *******************************************************************************/
4637 //DOM-IGNORE-BEGIN
4638 /*******************************************************************************
4639 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4640 Microchip licenses to you the right to use, modify, copy and distribute Software
4641 only when embedded on a Microchip microcontroller or digital signal controller
4642 that is integrated into your product or third party product (pursuant to the
4643 sublicense terms in the accompanying license agreement).
4644 You should refer to the license agreement accompanying this Software for
4645 additional information regarding your rights and obligations.
4646 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4647 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4648 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4649 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4650 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4651 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4652 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4653 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4654 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4655 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4656 *******************************************************************************/
4657 //DOM-IGNORE-END
4658 #ifndef _DRV_USART_STATIC_LOCAL_H
4659 #define _DRV_USART_STATIC_LOCAL_H
4660 // *****************************************************************************
4661 // *****************************************************************************
4662 // Section: Included Files
4663 // *****************************************************************************
4664 // *****************************************************************************
4665 #include <stdint.h>
4666 #include <stdbool.h>
4667 #include <stddef.h>
4668 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h */
4669 /*******************************************************************************
4670  USART Driver Interface Header File
4671  Company:
4672  Microchip Technology Inc.
4673  File Name:
4674  drv_usart.h
4675  Summary:
4676  USART Driver Interface Header File
4677  Description:
4678  The USART device driver provides a simple interface to manage the USART or
4679  UART modules on Microchip microcontrollers. This file provides the
4680  interface definition for the USART driver.
4681 *******************************************************************************/
4682 //DOM-IGNORE-BEGIN
4683 /*******************************************************************************
4684 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4685 Microchip licenses to you the right to use, modify, copy and distribute
4686 Software only when embedded on a Microchip microcontroller or digital signal
4687 controller that is integrated into your product or third party product
4688 (pursuant to the sublicense terms in the accompanying license agreement).
4689 You should refer to the license agreement accompanying this Software for
4690 additional information regarding your rights and obligations.
4691 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4692 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4693 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4694 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4695 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4696 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4697 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4698 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4699 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4700 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4701 *******************************************************************************/
4702 //DOM-IGNORE-END
4703 #ifndef _DRV_USART_H
4704 #define _DRV_USART_H
4705 // *****************************************************************************
4706 // *****************************************************************************
4707 // Section: File includes
4708 // *****************************************************************************
4709 // *****************************************************************************
4710 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h */
4711 /*******************************************************************************
4712  USART Driver Definitions Header File
4713  Company:
4714  Microchip Technology Inc.
4715  File Name:
4716  drv_usart_definitions.h
4717  Summary:
4718  USART Driver Definitions Header File
4719  Description:
4720  This file will provide enumerations and other dependencies needed by
4721  USART driver to manage the USART/UART module on PIC32 microcontrollers.
4722 *******************************************************************************/
4723 //DOM-IGNORE-BEGIN
4724 /*******************************************************************************
4725 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4726 Microchip licenses to you the right to use, modify, copy and distribute
4727 Software only when embedded on a Microchip microcontroller or digital signal
4728 controller that is integrated into your product or third party product
4729 (pursuant to the sublicense terms in the accompanying license agreement).
4730 You should refer to the license agreement accompanying this Software for
4731 additional information regarding your rights and obligations.
4732 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4733 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4734 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4735 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4736 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4737 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4738 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4739 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4740 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4741 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4742 *******************************************************************************/
4743 //DOM-IGNORE-END
4744 #ifndef _DRV_USART_DEFINITIONS_H
4745 #define _DRV_USART_DEFINITIONS_H
4746 // *****************************************************************************
4747 // *****************************************************************************
4748 // Section: File includes
4749 // *****************************************************************************
4750 // *****************************************************************************
4751 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
4752 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
4753 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h */
4754 /*******************************************************************************
4755  USART Peripheral Library Interface Header
4756  Company:
4757  Microchip Technology Inc.
4758  File Name:
4759  plib_usart.h
4760  Summary:
4761  USART Peripheral Library interface header.
4762  Description:
4763  This header file contains the function prototypes and definitions of
4764  the data types and constants that make up the interface to the USART
4765  Peripheral Library for all families of Microchip microcontrollers. The
4766  functions in this file are common to the USART module.
4767  *******************************************************************************/
4768 // DOM-IGNORE-BEGIN
4769 /*******************************************************************************
4770 Copyright 2010-2015 released Microchip Technology Inc. All rights reserved.
4771 Microchip licenses to you the right to use, modify, copy and distribute
4772 Software only when embedded on a Microchip microcontroller or digital signal
4773 controller that is integrated into your product or third party product
4774 (pursuant to the sublicense terms in the accompanying license agreement).
4775 You should refer to the license agreement accompanying this Software for
4776 additional information regarding your rights and obligations.
4777 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4778 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4779 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4780 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4781 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4782 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4783 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4784 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4785 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4786 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4787  *******************************************************************************/
4788 // DOM-IGNORE-END
4789 #ifndef _PLIB_USART_H
4790 #define _PLIB_USART_H
4791 // DOM-IGNORE-BEGIN
4792 // DOM-IGNORE-END
4793 // ****************************************************************************
4794 // ****************************************************************************
4795 // Section: Included Files
4796 // ****************************************************************************
4797 // ****************************************************************************
4798 /* This section lists the other files that are included in this file.
4799 */
4800 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h */
4801 /*******************************************************************************
4802  Processor Selector File for the USART
4803  Company:
4804  Microchip Technology Incorporated
4805  File Name:
4806  processor.h
4807  Summary:
4808  Selects the appropriate header for the part family
4809  Description:
4810  This file selects the appropriate header for the part family
4811  *******************************************************************************/
4812 // DOM-IGNORE-BEGIN
4813 /*******************************************************************************
4814 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
4815 Microchip licenses to you the right to use, modify, copy and distribute
4816 Software only when embedded on a Microchip microcontroller or digital signal
4817 controller that is integrated into your product or third party product
4818 (pursuant to the sublicense terms in the accompanying license agreement).
4819 You should refer to the license agreement accompanying this Software for
4820 additional information regarding your rights and obligations.
4821 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4822 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4823 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4824 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4825 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4826 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4827 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4828 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4829 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4830 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4831  *******************************************************************************/
4832 // DOM-IGNORE-END
4833 #ifndef _USART_PROCESSOR_H
4834 #define _USART_PROCESSOR_H
4835 // *****************************************************************************
4836 // *****************************************************************************
4837 // Section: Included Files
4838 // *****************************************************************************
4839 // *****************************************************************************
4840 /* This section lists the other files that are included in this file.
4841  */
4842 #include <stdint.h>
4843 #include <stdbool.h>
4844 #error "No Processor Family specified"
4845  //
4846  // _USART_PROCESSOR_H
4847 /*******************************************************************************
4848  End of File
4849  */
4850 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h*/
4851 /* CLOSE_FILE Include File */
4852 
4853 // ****************************************************************************
4854 // ****************************************************************************
4855 // Section: USART Peripheral Library Interface Functions
4856 // ****************************************************************************
4857 // ****************************************************************************
4858 //******************************************************************************
4859 /* Function:
4860  void PLIB_USART_RunInOverflowEnable ( USART_MODULE_ID index )
4861  Summary:
4862  Enables the USART module to continue to operate when an overflow error
4863  condition has occurred.
4864  Description:
4865  This function enables the USART module to continue to operate when an
4866  overflow error condition has occurred.
4867  This operation is atomic.
4868  Precondition:
4869  None.
4870  Parameters:
4871  index - Identifier for the device instance to be configured
4872  Returns:
4873  None.
4874  Example:
4875  <code>
4876 #define MY_USART_INSTANCE USART_ID_1
4877  PLIB_USART_RunInOverflowEnable (MY_USART_INSTANCE);
4878  </code>
4879  Remarks:
4880  This feature may not be available on all devices. Please refer to the
4881  specific device data sheet to determine availability or use
4882  PLIB_USART_ExistsRunInOverflow in your application to determine
4883  whether this feature is available.
4884 */
4885 
4886 void
4888  USART_MODULE_ID index ) ;
4889 //******************************************************************************
4890 /* Function:
4891  void PLIB_USART_RunInOverflowDisable ( USART_MODULE_ID index )
4892  Summary:
4893  Disables the Run in overflow condition mode.
4894  Description:
4895  This function disables the USART module from accepting new data when an overflow
4896  error condition is detected.
4897  This operation is atomic.
4898  Precondition:
4899  None.
4900  Parameters:
4901  index - Identifier for the device instance to be configured
4902  Returns:
4903  None.
4904  Example:
4905  <code>
4906 #define MY_USART_INSTANCE USART_ID_1
4907  PLIB_USART_RunInOverflowDisable (MY_USART_INSTANCE);
4908  </code>
4909  Remarks:
4910  This feature may not be available on all devices. Please refer to the
4911  specific device data sheet to determine availability or use
4912  PLIB_USART_ExistsRunInOverflow in your application to determine
4913  whether this feature is available.
4914 */
4915 
4916 void
4918  USART_MODULE_ID index ) ;
4919 //******************************************************************************
4920 /* Function:
4921  bool PLIB_USART_RunInOverflowIsEnabled ( USART_MODULE_ID index )
4922  Summary:
4923  Gets the status of the Run in Overflow condition.
4924  Description:
4925  This function indicates if the USART module has been enabled to run in
4926  an overflow condition.
4927  This operation is atomic.
4928  Precondition:
4929  None.
4930  Parameters:
4931  index - Identifier for the device instance
4932  Returns:
4933  - true - Run in overflow condition is enabled
4934  - false - Run in overflow condition is disabled
4935  Example:
4936  <code>
4937 #define MY_USART_INSTANCE USART_ID_1
4938  bool status;
4939  status = PLIB_USART_RunInOverflowIsEnabled (MY_USART_INSTANCE);
4940  </code>
4941  Remarks:
4942  This feature may not be available on all devices. Please refer to the
4943  specific device data sheet to determine availability or use
4944  PLIB_USART_ExistsRunInOverflow in your application to determine
4945  whether this feature is available.
4946 */
4947 
4948 bool
4950  USART_MODULE_ID index ) ;
4951 //******************************************************************************
4952 /* Function:
4953  void PLIB_USART_BRGClockSourceSelect
4954  (
4955  USART_MODULE_ID index,
4956  USART_BRG_CLOCK_SOURCE brgClockSource
4957  )
4958  Summary:
4959  Configures the BRG clock source of the USART module.
4960  Description:
4961  This function configures the BRG Clock source of the USART. Refer to
4962  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4963  Precondition:
4964  None.
4965  Parameters:
4966  index - Identifier for the device instance to be configured
4967  brgClockSource - One of the possible values from USART_BRG_CLOCK_SOURCE
4968  Returns:
4969  None.
4970  Example:
4971  <code>
4972 #define MY_USART_INSTANCE USART_ID_1
4973  PLIB_USART_BRGClockSourceSelect (MY_USART_INSTANCE, USART_BRG_CLOCK_SOURCE_FRC_IN_SLEEP);
4974  </code>
4975  Remarks:
4976  This feature may not be available on all devices. Please refer to the
4977  specific device data sheet to determine availability or use
4978  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4979  whether this feature is available.
4980 */
4981 
4982 void
4984  USART_MODULE_ID index ,
4985  USART_BRG_CLOCK_SOURCE brgClockSource ) ;
4986 //******************************************************************************
4987 /* Function:
4988  USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet ( USART_MODULE_ID index )
4989  Summary:
4990  Gets the BRG clock source of the USART module.
4991  Description:
4992  This function returns the BRG Clock source of the USART. Refer to
4993  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4994  This operation is atomic.
4995  Precondition:
4996  None.
4997  Parameters:
4998  index - Identifier for the device instance
4999  Returns:
5000  One of the possible values of USART_BRG_CLOCK_SOURCE
5001  Example:
5002  <code>
5003 #define MY_USART_INSTANCE USART_ID_1
5004  USART_BRG_CLOCK_SOURCE brgClockSource;
5005  brgClockSource = PLIB_USART_BRGClockSourceGet (MY_USART_INSTANCE);
5006  </code>
5007  Remarks:
5008  This feature may not be available on all devices. Please refer to the
5009  specific device data sheet to determine availability or use
5010  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
5011  whether this feature is available.
5012 */
5013 
5014 USART_BRG_CLOCK_SOURCE
5016  USART_MODULE_ID index ) ;
5017 //******************************************************************************
5018 /* Function:
5019  bool PLIB_USART_ModuleIsBusy ( USART_MODULE_ID index )
5020  Summary:
5021  Returns the USART module's running status.
5022  Description:
5023  This function checks if the USART module status is busy. The following
5024  functions should not be used when the module status is busy:
5025  - PLIB_USART_LineControlModeSelect
5026  - PLIB_USART_BaudRateHighSet
5027  - PLIB_USART_BaudRateHighEnable
5028  - PLIB_USART_BaudRateHighDisable
5029  - PLIB_USART_ReceiverIdleStateLowEnable
5030  - PLIB_USART_ReceiverIdleStateLowDisable
5031  - PLIB_USART_BaudRateAutoDetectEnable
5032  - PLIB_USART_LoopbackEnable
5033  - PLIB_USART_LoopbackDisable
5034  - PLIB_USART_WakeOnStartEnable
5035  - PLIB_USART_WakeOnStartDisable
5036  - PLIB_USART_OperationModeSelect
5037  - PLIB_USART_HandshakeModeSelect
5038  - PLIB_USART_IrDAEnable
5039  - PLIB_USART_IrDADisable
5040  - PLIB_USART_StopInIdleEnable
5041  - PLIB_USART_StopInIdleDisable
5042  - PLIB_USART_RunInOverflowEnable
5043  - PLIB_USART_RunInOverflowDisable
5044  - PLIB_USART_BRGClockSourceSelect
5045  - PLIB_USART_RunInSleepModeEnable
5046  - PLIB_USART_RunInSleepModeDisable
5047  This operation is atomic.
5048  Precondition:
5049  None.
5050  Parameters:
5051  index - Identifier for the device instance
5052  Returns:
5053  - true - USART module is busy
5054  - false - USART module is idle
5055  Example:
5056  <code>
5057 #define MY_USART_INSTANCE USART_ID_1
5058  bool moduleStatus;
5059  moduleStatus = PLIB_USART_ModuleIsBusy (MY_USART_INSTANCE);
5060  </code>
5061  Remarks:
5062  This feature may not be available on all devices. Please refer to the
5063  specific device data sheet to determine availability or use
5064  PLIB_USART_ExistsModuleBusyStatus in your application to determine
5065  whether this feature is available.
5066 */
5067 
5068 bool
5070  USART_MODULE_ID index ) ;
5071 //******************************************************************************
5072 /* Function:
5073  void PLIB_USART_RunInSleepModeEnable ( USART_MODULE_ID index )
5074  Summary:
5075  Allows the USART module's BRG clock to run when the device enters Sleep mode.
5076  Description:
5077  This function enables the USART module's BRG clock to continue operation when
5078  the device enters the Sleep mode.
5079  This operation is atomic.
5080  Precondition:
5081  None.
5082  Parameters:
5083  index - Identifier for the device instance to be configured
5084  Returns:
5085  None.
5086  Example:
5087  <code>
5088 #define MY_USART_INSTANCE USART_ID_1
5089  PLIB_USART_RunInSleepModeEnable (MY_USART_INSTANCE);
5090  </code>
5091  Remarks:
5092  This feature may not be available on all devices. Please refer to the
5093  specific device data sheet to determine availability or use
5094  PLIB_USART_ExistsRunInSleepMode in your application to determine
5095  whether this feature is available.
5096 */
5097 
5098 void
5100  USART_MODULE_ID index ) ;
5101 //******************************************************************************
5102 /* Function:
5103  void PLIB_USART_RunInSleepModeDisable ( USART_MODULE_ID index )
5104  Summary:
5105  Turns off the USART module's BRG clock during Sleep mode.
5106  Description:
5107  This function turns off the USART module's BRG clock during Sleep mode.
5108  This operation is atomic.
5109  Precondition:
5110  None.
5111  Parameters:
5112  index - Identifier for the device instance to be configured
5113  Returns:
5114  None.
5115  Example:
5116  <code>
5117 #define MY_USART_INSTANCE USART_ID_1
5118  PLIB_USART_RunInSleepModeDisable (MY_USART_INSTANCE);
5119  </code>
5120  Remarks:
5121  This feature may not be available on all devices. Please refer to the
5122  specific device data sheet to determine availability or use
5123  PLIB_USART_ExistsRunInSleepMode in your application to determine
5124  whether this feature is available.
5125 */
5126 
5127 void
5129  USART_MODULE_ID index ) ;
5130 //******************************************************************************
5131 /* Function:
5132  bool PLIB_USART_RunInSleepModeIsEnabled ( USART_MODULE_ID index )
5133  Summary:
5134  Gets the status of Run in Sleep mode.
5135  Description:
5136  This function indicates if the USART module has been enabled to run in
5137  Sleep mode.
5138  This operation is atomic.
5139  Precondition:
5140  None.
5141  Parameters:
5142  index - Identifier for the device instance
5143  Returns:
5144  - true - Run in Sleep mode is enabled
5145  - false - Run in Sleep mode is disabled
5146  Example:
5147  <code>
5148 #define MY_USART_INSTANCE USART_ID_1
5149  bool status;
5150  status = PLIB_USART_RunInSleepModeIsEnabled (MY_USART_INSTANCE);
5151  </code>
5152  Remarks:
5153  This feature may not be available on all devices. Please refer to the
5154  specific device data sheet to determine availability or use
5155  PLIB_USART_ExistsRunInSleepMode in your application to determine
5156  whether this feature is available.
5157 */
5158 
5159 bool
5161  USART_MODULE_ID index ) ;
5162 //******************************************************************************
5163 /* Function:
5164  void PLIB_USART_Enable ( USART_MODULE_ID index )
5165  Summary:
5166  Enables the specific USART module.
5167  Description:
5168  This function enables the specific USART module.
5169  This operation is atomic.
5170  Precondition:
5171  None.
5172  Parameters:
5173  index - Identifier for the device instance to be configured
5174  Returns:
5175  None.
5176  Example:
5177  <code>
5178 #define MY_USART_INSTANCE USART_ID_1
5179  PLIB_USART_Enable(MY_USART_INSTANCE);
5180  </code>
5181  Remarks:
5182  By calling this function, the USART pins are controlled by the USART
5183  module.
5184  This feature may not be available on all devices. Please refer to the
5185  specific device data sheet to determine availability or use
5186  PLIB_USART_ExistsEnable in your application to determine whether
5187  this feature is available.
5188 */
5189 
5190 void
5192  USART_MODULE_ID index ) ;
5193 //******************************************************************************
5194 /* Function:
5195  void PLIB_USART_Disable ( USART_MODULE_ID index )
5196  Summary:
5197  Disables the specific USART module
5198  Description:
5199  This function disables the specific USART module.
5200  This operation is atomic.
5201  Precondition:
5202  None.
5203  Parameters:
5204  index - Identifier for the device instance to be configured
5205  Returns:
5206  None.
5207  Example:
5208  <code>
5209 #define MY_USART_INSTANCE USART_ID_1
5210  PLIB_USART_Disable(MY_USART_INSTANCE);
5211  </code>
5212  Remarks:
5213  The default state after any reset for a USART module is the disable state.
5214  If the USART is disabled, all of the related pins are in control of the
5215  general purpose I/O logic.
5216 
5217  Disabling the USART module resets the buffers to empty states. Any data
5218  characters in the buffers are lost and the baud rate is reset. All error
5219  and status bits are also reset.
5220 
5221  Disabling the USART while the USART is active, will abort all pending
5222  transmissions and receptions. Re-enabling the USART will restart the
5223  module in the same configuration.
5224 
5225  When disabled, the USART power consumption is minimal.
5226  This feature may not be available on all devices. Please refer to the
5227  specific device data sheet to determine availability or use
5228  PLIB_USART_ExistsEnable in your application to determine whether
5229  this feature is available.
5230 */
5231 
5232 void
5234  USART_MODULE_ID index ) ;
5235 //******************************************************************************
5236 /* Function:
5237  void PLIB_USART_TransmitterEnable ( USART_MODULE_ID index )
5238  Summary:
5239  Enables the specific USART module transmitter.
5240  Description:
5241  This function enables the specific USART module transmitter.
5242  This operation is atomic.
5243  Precondition:
5244  The USART module should be enabled using the function PLIB_USART_Enable
5245  before this function is called.
5246  Parameters:
5247  index - Identifier for the device instance to be configured
5248  Returns:
5249  None.
5250  Example:
5251  <code>
5252 #define MY_USART_INSTANCE USART_ID_1
5253  PLIB_USART_TransmitterEnable(MY_USART_INSTANCE);
5254  </code>
5255  Remarks:
5256  The transmitter should not be enabled until the USART is enabled.
5257  The transmissions will not be enabled otherwise.
5258 
5259  This feature may not be available on all devices. Please refer to the
5260  specific device data sheet to determine availability or use
5261  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
5262  this feature is available.
5263 */
5264 
5265 void
5267  USART_MODULE_ID index ) ;
5268 //******************************************************************************
5269 /* Function:
5270  void PLIB_USART_TransmitterDisable ( USART_MODULE_ID index )
5271  Summary:
5272  Disables the specific USART module transmitter.
5273  Description:
5274  This function disables the specific USART module transmitter.
5275  This operation is atomic.
5276  Precondition:
5277  None.
5278  Parameters:
5279  index - Identifier for the device instance to be configured
5280  Returns:
5281  None.
5282  Example:
5283  <code>
5284 #define MY_USART_INSTANCE USART_ID_1
5285  PLIB_USART_TransmitterDisable(MY_USART_INSTANCE);
5286  </code>
5287  Remarks:
5288  Disabling the transmitter during a transmission will cause the
5289  transmission to be aborted.
5290 
5291  This feature may not be available on all devices. Please refer to the
5292  specific device data sheet to determine availability or use
5293  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
5294  this feature is available.
5295 */
5296 
5297 void
5299  USART_MODULE_ID index ) ;
5300 //******************************************************************************
5301 /* Function:
5302  void PLIB_USART_BaudRateSet ( USART_MODULE_ID index, uint32_t clockFrequency,
5303  uint32_t baudRate );
5304  Summary:
5305  Sets the baud rate to the desired value.
5306  Description:
5307  This function sets the baud rate to the desired value.
5308  Precondition:
5309  None.
5310  Parameters:
5311  index - Identifier for the device instance to be configured
5312  baudRate - Baud Rate Value
5313  clockFrequency - Clock Frequency
5314  Returns:
5315  None.
5316  Example:
5317  <code>
5318 #define MY_USART_INSTANCE USART_ID_1
5319  uint32_t baudRateValue ;
5320  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5321  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5322  </code>
5323  Remarks:
5324  Setting a new baud rate value causes the baud rate timer to reset.
5325  This ensures that the baud rate timer does not have to overflow before
5326  outputting the new baud rate.
5327 
5328  If the system clock is changed during an active receive operation, a
5329  receiver error or data loss may result. To avoid this issue verify that
5330  no receptions are in progress before changing the system clock.
5331 
5332  This feature may not be available on all devices. Please refer to the
5333  specific device data sheet to determine availability or use
5334  PLIB_USART_ExistsBaudRate in your application to determine whether
5335  this feature is available.
5336 */
5337 
5338 void
5340  USART_MODULE_ID index ,
5341  uint32_t clockFrequency ,
5342  uint32_t baudRate ) ;
5343 //******************************************************************************
5344 /* Function:
5345  void PLIB_USART_BaudRateHighSet ( USART_MODULE_ID index,
5346  uint32_t clockFrequency, uint32_t baudRate );
5347  Summary:
5348  Sets the baud rate to the desired value.
5349  Description:
5350  This function sets the baud rate to the desired value.
5351  Precondition:
5352  None.
5353  Parameters:
5354  index - Identifier for the device instance to be configured
5355  baudRate - Baud Rate Value, it is the baud rate value
5356  clockFrequency - Clock Frequency
5357  Returns:
5358  None.
5359  Example:
5360  <code>
5361 #define MY_USART_INSTANCE USART_ID_1
5362  uint32_t baudRateValue ;
5363  PLIB_USART_BaudRateHighSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5364  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5365  </code>
5366  Remarks:
5367  Setting a new baud rate value causes the baud rate timer to reset.
5368  This ensures that the baud rate timer does not have to overflow before
5369  outputting the new baud rate.
5370 
5371  If the system clock is changed during an active receive operation, a
5372  receiver error or data loss may result. To avoid this issue verify that
5373  no receptions are in progress before changing the system clock.
5374 
5375  This feature may not be available on all devices. Please refer to the
5376  specific device data sheet to determine availability or use
5377  PLIB_USART_ExistsBaudRateHigh in your application to determine whether
5378  this feature is available.
5379 */
5380 
5381 void
5383  USART_MODULE_ID index ,
5384  uint32_t clockFrequency ,
5385  uint32_t baudRate ) ;
5386 //******************************************************************************
5387 /* Function:
5388  uint32_t PLIB_USART_BaudRateGet ( USART_MODULE_ID index,
5389  int32_t clockFrequency );
5390  Summary:
5391  Gets the baud rate current in use.
5392  Description:
5393  This function gets the baud rate that is currently in use. The clock frequency
5394  needs to be passed to the function.
5395  Conditions:
5396  None.
5397  Input:
5398  index - Identifier for the device instance to be configured
5399  clockFrequency - Clock Frequency
5400  Returns:
5401  - BaudRate - Baud rate value
5402  Example:
5403  <code>
5404 #define MY_USART_INSTANCE USART_ID_1
5405  uint32_t baudRate ;
5406  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5407  baudRate = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5408  </code>
5409  Remarks:
5410  This feature may not be available on all devices. Please refer to the
5411  specific device data sheet to determine availability or use
5412  PLIB_USART_ExistsBaudRate in your application to determine whether
5413  this feature is available.
5414 */
5415 
5416 uint32_t
5418  USART_MODULE_ID index ,
5419  int32_t clockFrequency ) ;
5420 //******************************************************************************
5421 /* Function:
5422  void PLIB_USART_AddressSet
5423  (
5424  USART_MODULE_ID index,
5425  uint8_t address
5426  )
5427  Summary:
5428  Sets the address for the Address Detect mode.
5429  Description:
5430  This function sets the address for the Address Detect mode.
5431  This operation is atomic.
5432  Precondition:
5433  None.
5434  Parameters:
5435  index - Identifier for the device instance to be configured
5436  address - Address
5437  Returns:
5438  None.
5439  Example:
5440  <code>
5441 #define MY_USART_INSTANCE USART_ID_1
5442  uint8_t address = 0x02;
5443  PLIB_USART_AddressSet (MY_USART_INSTANCE, address);
5444  </code>
5445  Remarks:
5446  This feature may not be available on all devices. Please refer to the
5447  specific device data sheet to determine availability or use
5448  PLIB_USART_ExistsReceiverAddress in your application to determine
5449  whether this feature is available.
5450 */
5451 
5452 void
5454  USART_MODULE_ID index ,
5455  uint8_t address ) ;
5456 //******************************************************************************
5457 /* Function:
5458  uint8_t PLIB_USART_AddressGet
5459  (
5460  USART_MODULE_ID index
5461  )
5462  Summary:
5463  Gets the address for the Address Detect mode.
5464  Description:
5465  This function returns the address value being used for the Address
5466  Detect mode.
5467  This operation is atomic.
5468  Precondition:
5469  None.
5470  Parameters:
5471  index - Identifier for the device instance
5472  Returns:
5473  - address - The address being used
5474  Example:
5475  <code>
5476 #define MY_USART_INSTANCE USART_ID_1
5477  uint8_t address = 0;
5478  address = PLIB_USART_AddressGet (MY_USART_INSTANCE);
5479  </code>
5480  Remarks:
5481  This feature may not be available on all devices. Please refer to the
5482  specific device data sheet to determine availability or use
5483  PLIB_USART_ExistsReceiverAddress in your application to determine
5484  whether this feature is available.
5485 */
5486 
5487 uint8_t
5489  USART_MODULE_ID index ) ;
5490 //******************************************************************************
5491 /* Function:
5492  void PLIB_USART_AddressMaskSet
5493  (
5494  USART_MODULE_ID index,
5495  uint8_t mask
5496  )
5497  Summary:
5498  Sets the address mask for the Address Detect mode.
5499  Description:
5500  This function sets the address mask for the Address Detect mode.
5501  This operation is atomic.
5502  Precondition:
5503  None.
5504  Parameters:
5505  index - Identifier for the device instance to be configured
5506  mask - Address match mask bits
5507  Returns:
5508  None.
5509  Example:
5510  <code>
5511 #define MY_USART_INSTANCE USART_ID_1
5512  uint8_t mask = 0x0F;
5513  PLIB_USART_AddressMaskSet (MY_USART_INSTANCE, mask);
5514  </code>
5515  Remarks:
5516  This feature may not be available on all devices. Please refer to the
5517  specific device data sheet to determine availability or use
5518  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5519  whether this feature is available.
5520 */
5521 
5522 void
5524  USART_MODULE_ID index ,
5525  uint8_t mask ) ;
5526 //******************************************************************************
5527 /* Function:
5528  uint8_t PLIB_USART_AddressMaskGet
5529  (
5530  USART_MODULE_ID index
5531  )
5532  Summary:
5533  Gets the address mask for the Address Detect mode.
5534  Description:
5535  This function returns the address mask value being used for the Address
5536  Detect mode.
5537  This operation is atomic.
5538  Precondition:
5539  None.
5540  Parameters:
5541  index - Identifier for the device instance to be configured
5542  Returns:
5543  - mask - Address mask being used
5544  Example:
5545  <code>
5546 #define MY_USART_INSTANCE USART_ID_1
5547  uint8_t mask = 0;
5548  mask = PLIB_USART_AddressMaskGet (MY_USART_INSTANCE);
5549  </code>
5550  Remarks:
5551  This feature may not be available on all devices. Please refer to the
5552  specific device data sheet to determine availability or use
5553  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5554  whether this feature is available.
5555 */
5556 
5557 uint8_t
5559  USART_MODULE_ID index ) ;
5560 //******************************************************************************
5561 /* Function:
5562  void PLIB_USART_ReceiverAddressDetectEnable ( USART_MODULE_ID index )
5563  Summary:
5564  Enables the Address Detect mode.
5565  Description:
5566  This function enables the Address Detect mode. If it is enabled, and the
5567  device is addressed, disable the Address Detect mode to continue receiving
5568  bytes.
5569  This operation is atomic.
5570  Precondition:
5571  None.
5572  Parameters:
5573  index - Identifier for the device instance to be configured
5574  Returns:
5575  None.
5576  Example:
5577  <code>
5578 #define MY_USART_INSTANCE USART_ID_1
5579  PLIB_USART_ReceiverAddressDetectEnable(MY_USART_INSTANCE);
5580  </code>
5581  Remarks:
5582  If 9 data bits are not selected, this bit has no effect.
5583  This feature may not be available on all devices. Please refer to the
5584  specific device data sheet to determine availability or use
5585  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5586  this feature is available.
5587 */
5588 
5589 void
5591  USART_MODULE_ID index ) ;
5592 //******************************************************************************
5593 /* Function:
5594  void PLIB_USART_ReceiverAddressDetectDisable ( USART_MODULE_ID index )
5595  Summary:
5596  Enables the Address Detect mode.
5597  Description:
5598  This function disables the Address Detect mode. If it is enabled, and the
5599  device is addressed, disable the Address Detect mode to continue receiving
5600  bytes.
5601  This operation is atomic.
5602  Precondition:
5603  None.
5604  Parameters:
5605  index - Identifier for the device instance to be configured
5606  Returns:
5607  None.
5608  Example:
5609  <code>
5610 #define MY_USART_INSTANCE USART_ID_1
5611  PLIB_USART_ReceiverAddressDetectDisable(MY_USART_INSTANCE);
5612  </code>
5613  Remarks:
5614  All bytes are received, and the 9th bit can be used as the parity bit.
5615  By default, the address detect is disabled.
5616 
5617  This feature may not be available on all devices. Please refer to the
5618  specific device data sheet to determine availability or use
5619  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5620  this feature is available.
5621 */
5622 
5623 void
5625  USART_MODULE_ID index ) ;
5626 //******************************************************************************
5627 /* Function:
5628  bool PLIB_USART_BaudRateAutoDetectIsComplete ( USART_MODULE_ID index )
5629  Summary:
5630  Gets the state of the automatic baud detection.
5631  Description:
5632  This function gets the state of the automatic baud detection and returns a '0'
5633  if the baud rate auto detection is complete.
5634  This operation is atomic.
5635  Precondition:
5636  None.
5637  Parameters:
5638  index - Identifier for the device instance to be configured
5639  Returns:
5640  - true - Baud rate detection is not complete
5641  - false - Baud rate detection is complete
5642  Example:
5643  <code>
5644 #define MY_USART_INSTANCE USART_ID_1
5645  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5646  // Wait until the baud rate is detected.
5647  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5648  </code>
5649  Remarks:
5650  This feature may not be available on all devices. Please refer to the
5651  specific device data sheet to determine availability or use
5652  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5653  this feature is available.
5654 */
5655 
5656 bool
5658  USART_MODULE_ID index ) ;
5659 //******************************************************************************
5660 /* Function:
5661  void PLIB_USART_BaudRateAutoDetectEnable ( USART_MODULE_ID index )
5662  Summary:
5663  Enables baud rate measurement on the next character, which requires reception
5664  of the Sync character.
5665  Description:
5666  This function enables the baud rate measurement on the next character,
5667  which requires reception of the Sync character.
5668  This operation is atomic.
5669  Precondition:
5670  None.
5671  Parameters:
5672  index - Identifier for the device instance to be configured
5673  Returns:
5674  None.
5675  Example:
5676  <code>
5677 #define MY_USART_INSTANCE USART_ID_1
5678  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5679  // Wait until the baud rate is detected.
5680  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5681  </code>
5682  Remarks:
5683  This feature may not be available on all devices. Please refer to the
5684  specific device data sheet to determine availability or use
5685  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5686  this feature is available.
5687 */
5688 
5689 void
5691  USART_MODULE_ID index ) ;
5692 //******************************************************************************
5693 /* Function:
5694  void PLIB_USART_TransmitterByteSend ( USART_MODULE_ID index, int8_t data )
5695  Summary:
5696  Data to be transmitted in the Byte mode.
5697  Description:
5698  The data is transmitted in the Byte mode for the specified USART module.
5699  This operation is atomic.
5700  Precondition:
5701  None.
5702  Parameters:
5703  index - Identifier for the device instance to be configured
5704  data - Data to be transmitted.
5705  Returns:
5706  None.
5707  Example:
5708  <code>
5709 #define MY_USART_INSTANCE USART_ID_1
5710  uint8_t data = 'a';
5711  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5712  {
5713  PLIB_USART_TransmitterByteSend(MY_USART_INSTANCE, data);
5714  }
5715  </code>
5716  Remarks:
5717  This feature may not be available on all devices. Please refer to the
5718  specific device data sheet to determine availability or use
5719  PLIB_USART_ExistsTransmitter in your application to determine whether
5720  this feature is available.
5721 */
5722 
5723 void
5725  USART_MODULE_ID index ,
5726  int8_t data ) ;
5727 //******************************************************************************
5728 /* Function:
5729  int8_t PLIB_USART_ReceiverByteReceive ( USART_MODULE_ID index )
5730  Summary:
5731  Data to be received in the Byte mode.
5732  Description:
5733  The data to be received in Byte mode from the specified USART module.
5734  This operation is atomic.
5735  Call the functions PLIB_USART_ReceiverFramingErrorHasOccurred,
5736  PLIB_USART_ReceiverParityErrorHasOccurred and
5737  PLIB_USART_ReceiverOverrunHasOccurred to get any error that occurred.
5738  Precondition:
5739  None.
5740  Parameters:
5741  index - Identifier for the device instance to be configured
5742  Returns:
5743  - data - Data to be received
5744  Example:
5745  <code>
5746 #define MY_USART_INSTANCE USART_ID_1
5747  bool isError;
5748  uint8_t mydata;
5749  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5750  {
5751  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5752  }
5753  isError = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE) |
5754  PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE) |
5755  PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE);
5756  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5757  {
5758  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5759  }
5760  </code>
5761  Remarks:
5762  This feature may not be available on all devices. Please refer to the
5763  specific device data sheet to determine availability or use
5764  PLIB_USART_ExistsReceiver in your application to determine whether
5765  this feature is available.
5766 */
5767 
5768 int8_t
5770  USART_MODULE_ID index ) ;
5771 //******************************************************************************
5772 /* Function:
5773  int16_t PLIB_USART_Receiver9BitsReceive ( USART_MODULE_ID index )
5774  Summary:
5775  Data to be received in the byte mode with the 9th bit.
5776  Description:
5777  The data to be received in Byte mode from the specified USART module.
5778  with the 9th bit.
5779  This operation is atomic.
5780  Precondition:
5781  None.
5782  Parameters:
5783  index - Identifier for the device instance to be configured
5784  Returns:
5785  - data - Data to be received
5786  Example:
5787  <code>
5788 #define MY_USART_INSTANCE USART_ID_1
5789  uint16_t mydata;
5790  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5791  {
5792  mydata = PLIB_USART_Receiver9BitsReceive (MY_USART_INSTANCE);
5793  }
5794  </code>
5795  Remarks:
5796  This feature may not be available on all devices. Please refer to the
5797  specific device data sheet to determine availability or use
5798  PLIB_USART_ExistsReceiver9Bits in your application to determine
5799  whether this feature is available.
5800 */
5801 
5802 int16_t
5804  USART_MODULE_ID index ) ;
5805 //******************************************************************************
5806 /* Function:
5807  bool PLIB_USART_ReceiverAddressIsReceived ( USART_MODULE_ID index )
5808  Summary:
5809  Checks and return if the data received is an address.
5810  Description:
5811  Checks and return if the data received is an address. The address has
5812  the 9th bit set. If data received has the 9th bit set, the function returns true;
5813  otherwise, the function returns false.
5814  This operation is atomic.
5815  Precondition:
5816  The USART module should be configured to use the 9 data bits.
5817  Parameters:
5818  index - Identifier for the device instance to be configured
5819  Returns:
5820  - true - if the data received has the 9th bit set
5821  - false - if the address received has the 9th bit cleared
5822  Example:
5823  <code>
5824 #define MY_USART_INSTANCE USART_ID_1
5825  int8_t address;
5826  if(PLIB_USART_ReceiverAddressIsReceived(MY_USART_INSTANCE))
5827  {
5828  address = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5829  }
5830  </code>
5831  Remarks:
5832  This feature may not be available on all devices. Please refer to the
5833  specific device data sheet to determine availability or use
5834  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5835  this feature is available.
5836 */
5837 
5838 bool
5840  USART_MODULE_ID index ) ;
5841 //******************************************************************************
5842 /* Function:
5843  void PLIB_USART_Transmitter9BitsSend ( USART_MODULE_ID index,
5844  int8_t data, bool 9thBit )
5845  Summary:
5846  Data to be transmitted in the byte mode with the 9th bit.
5847  Description:
5848  The data is transmitted in the byte mode for the specified USART module,
5849  with 9th bit.
5850  This operation is atomic.
5851  Precondition:
5852  The USART module should be configured to use the 9 data bits.
5853  Parameters:
5854  index - Identifier for the device instance to be configured
5855  data - Data to be transmitted.
5856  9thBit - 9th bit of the data to be transmitted.
5857  Returns:
5858  None.
5859  Example:
5860  <code>
5861 #define MY_USART_INSTANCE USART_ID_1
5862  uint8_t data = 'a';
5863  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5864  {
5865  PLIB_USART_Transmitter9BitsSend(MY_USART_INSTANCE, data, false);
5866  }
5867  </code>
5868  Remarks:
5869  This feature may not be available on all devices. Please refer to the
5870  specific device data sheet to determine availability or use
5871  PLIB_USART_ExistsTransmitter9BitsSend in your application to determine whether
5872  this feature is available.
5873 */
5874 
5875 void
5877  USART_MODULE_ID index ,
5878  int8_t data ,
5879  bool Bit9th ) ;
5880 //******************************************************************************
5881 /* Function:
5882  void PLIB_USART_TransmitterBreakSend ( USART_MODULE_ID index )
5883  Summary:
5884  Transmits the break character.
5885  Description:
5886  This function transmits the break character.
5887  This operation is atomic.
5888  Precondition:
5889  The application should wait for the transmitter to be idle, before calling
5890  this function.
5891  Parameters:
5892  index - Identifier for the device instance to be configured
5893  Returns:
5894  None.
5895  Example:
5896  <code>
5897 #define MY_USART_INSTANCE USART_ID_1
5898  // Wait for the Transmit buffer to be empty.
5899  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5900  // Transmit the break character.
5901  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5902  // wait for the break transmission to complete
5903  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5904  </code>
5905  Remarks:
5906  After the break has been transmitted, the application can start
5907  transmitting next bytes.
5908 
5909  This feature may not be available on all devices. Please refer to the
5910  specific device data sheet to determine availability or use
5911  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5912  this feature is available.
5913 */
5914 
5915 void
5917  USART_MODULE_ID index ) ;
5918 //******************************************************************************
5919 /* Function:
5920  bool PLIB_USART_TransmitterBreakSendIsComplete ( USART_MODULE_ID index )
5921  Summary:
5922  Returns the status of the break transmission
5923  Description:
5924  The function returns the status of the break transmission.
5925  This operation is atomic.
5926  Precondition:
5927  None.
5928  Parameters:
5929  index - Identifier for the device instance to be configured
5930  Returns:
5931  - true - Transmit break on the next transmission
5932  - false - Break transmission completed or not started
5933  Example:
5934  <code>
5935 #define MY_USART_INSTANCE USART_ID_1
5936  // Wait for the Transmit buffer to be empty.
5937  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5938  // Transmit the break character.
5939  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5940  // wait for the break transmission to complete
5941  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5942  </code>
5943  Remarks:
5944  After the break has been transmitted, the application can start
5945  transmitting next bytes.
5946 
5947  This feature may not be available on all devices. Please refer to the
5948  specific device data sheet to determine availability or use
5949  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5950  this feature is available.
5951 */
5952 
5953 bool
5955  USART_MODULE_ID index ) ;
5956 //******************************************************************************
5957 /* Function:
5958  bool PLIB_USART_ReceiverDataIsAvailable ( USART_MODULE_ID index )
5959  Summary:
5960  Identifies if the receive data is available for the specified USART module.
5961  Description:
5962  This function identifies if the receive data is available for the specified
5963  USART module.
5964  This operation is atomic.
5965  Precondition:
5966  None.
5967  Parameters:
5968  index - Identifier for the device instance to be configured
5969  Returns:
5970  - true - The data is available
5971  - false - The data is not available
5972  Example:
5973  <code>
5974 #define MY_USART_INSTANCE USART_ID_1
5975  int8_t mydata;
5976  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5977  {
5978  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5979  }
5980  </code>
5981  Remarks:
5982  This feature may not be available on all devices. Please refer to the
5983  specific device data sheet to determine availability or use
5984  PLIB_USART_ExistsReceiverDataAvailableStatus in your application to determine
5985  whether this feature is available.
5986 */
5987 
5988 bool
5990  USART_MODULE_ID index ) ;
5991 //******************************************************************************
5992 /* Function:
5993  void PLIB_USART_ReceiverOverrunErrorClear ( USART_MODULE_ID index )
5994  Summary:
5995  Clears a USART vverrun error.
5996  Description:
5997  This function clears an overrun error. Clearing the error, resets the receive buffer.
5998  This operation is atomic.
5999  Precondition:
6000  None.
6001  Parameters:
6002  index - Identifier for the device instance to be configured
6003  Returns:
6004  None.
6005  Example:
6006  <code>
6007 #define MY_USART_INSTANCE USART_ID_1
6008  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
6009  {
6010  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
6011  }
6012  </code>
6013  Remarks:
6014  WARNING: Calling this API will clear all of the previously received data.
6015 
6016  This feature may not be available on all devices. Please refer to the
6017  specific device data sheet to determine availability or use
6018  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
6019  whether this feature is available.
6020 */
6021 
6022 void
6024  USART_MODULE_ID index ) ;
6025 //******************************************************************************
6026 /* Function:
6027  bool PLIB_USART_TransmitterBufferIsFull ( USART_MODULE_ID index )
6028  Summary:
6029  Gets the transmit buffer full status.
6030  Description:
6031  This function gets the transmit status of the specified USART module.
6032  This operation is atomic.
6033  Precondition:
6034  None.
6035  Parameters:
6036  index - Identifier for the device instance to be configured
6037  Returns:
6038  - true - The transmit buffer is full
6039  - false - The transmit buffer is not full, at least one more
6040  character can be written
6041  Example:
6042  <code>
6043 #define MY_USART_INSTANCE USART_ID_1
6044  // Wait for the Transmit buffer to be empty.
6045  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
6046  // Transmit the break character.
6047  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
6048  </code>
6049  Remarks:
6050  This feature may not be available on all devices. Please refer to the
6051  specific device data sheet to determine availability or use
6052  PLIB_USART_ExistsTransmitterBufferFullStatus in your application to determine
6053  whether this feature is available.
6054 */
6055 
6056 bool
6058  USART_MODULE_ID index ) ;
6059 //******************************************************************************
6060 /* Function:
6061  bool PLIB_USART_TransmitterIsEmpty ( USART_MODULE_ID index )
6062  Summary:
6063  Gets the transmit shift register empty status.
6064  Description:
6065  This function gets the transmit shift register empty status.
6066  This operation is atomic.
6067  Precondition:
6068  None.
6069  Parameters:
6070  index - Identifier for the device instance to be configured
6071  Returns:
6072  - true - The transmit shift register is empty
6073  - false - The transmit shift register is not empty
6074  Example:
6075  <code>
6076 #define MY_USART_INSTANCE USART_ID_1
6077  // Wait for the Transmit buffer to be empty.
6078  while(!PLIB_USART_TransmitterIsEmpty(MY_USART_INSTANCE));
6079  // Transmit the break character.
6080  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
6081  </code>
6082  Remarks:
6083  This feature may not be available on all devices. Please refer to the
6084  specific device data sheet to determine availability or use
6085  PLIB_USART_ExistsTransmitterEmptyStatus in your application to determine
6086  whether this feature is available.
6087 */
6088 
6089 bool
6091  USART_MODULE_ID index ) ;
6092 //******************************************************************************
6093 /* Function:
6094  bool PLIB_USART_ReceiverFramingErrorHasOccurred ( USART_MODULE_ID index )
6095  Summary:
6096  Gets the framing error status.
6097  Description:
6098  This function gets the framing error status.
6099  This operation is atomic.
6100  Precondition:
6101  None.
6102  Parameters:
6103  index - Identifier for the device instance to be configured
6104  Returns:
6105  - true - The framing error was detected on the current character
6106  - false - The framing error was not detected on the current
6107  character
6108  Example:
6109  <code>
6110 #define MY_USART_INSTANCE USART_ID_1
6111  status = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE);
6112  </code>
6113  Remarks:
6114  Reading the error clears the error.
6115  This feature may not be available on all devices. Please refer to the
6116  specific device data sheet to determine availability or use
6117  PLIB_USART_ExistsReceiverFramingErrorStatus in your application to determine
6118  whether this feature is available.
6119 */
6120 
6121 bool
6123  USART_MODULE_ID index ) ;
6124 //******************************************************************************
6125 /* Function:
6126  bool PLIB_USART_ReceiverParityErrorHasOccurred ( USART_MODULE_ID index )
6127  Summary:
6128  Gets the parity error status.
6129  Description:
6130  This function gets the parity error status.
6131  This operation is atomic.
6132  Precondition:
6133  None.
6134  Parameters:
6135  index - Identifier for the device instance to be configured
6136  Returns:
6137  - true - The parity error was detected on the current character
6138  - false - The parity error was not detected on the current character
6139  Example:
6140  <code>
6141 #define MY_USART_INSTANCE USART_ID_1
6142  status = PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE);
6143  </code>
6144  Remarks:
6145  Reading the error clears the error.
6146  A Parity error is irrelevant in case of 9-bit mode.
6147  This feature may not be available on all devices. Please refer to the
6148  specific device data sheet to determine availability or use
6149  PLIB_USART_ExistsReceiverParityErrorStatus in your application to determine
6150  whether this feature is available.
6151 */
6152 
6153 bool
6155  USART_MODULE_ID index ) ;
6156 //******************************************************************************
6157 /* Function:
6158  bool PLIB_USART_ReceiverOverrunHasOccurred ( USART_MODULE_ID index )
6159  Summary:
6160  Identifies if there was a receiver overrun error.
6161  Description:
6162  This function identifies if there was a receiver overrun error.
6163  This operation is atomic.
6164  Precondition:
6165  None.
6166  Parameters:
6167  index - Identifier for the device instance to be configured
6168  Returns:
6169  - true - The receive buffer has overflowed
6170  - false - The receive buffer has not overflowed
6171  Example:
6172  <code>
6173 #define MY_USART_INSTANCE USART_ID_1
6174  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
6175  {
6176  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
6177  }
6178  </code>
6179  Remarks:
6180  This feature may not be available on all devices. Please refer to the
6181  specific device data sheet to determine availability or use
6182  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
6183  whether this feature is available.
6184 */
6185 
6186 bool
6188  USART_MODULE_ID index ) ;
6189 //******************************************************************************
6190 /* Function:
6191  bool PLIB_USART_ReceiverIsIdle ( USART_MODULE_ID index )
6192  Summary:
6193  Identifies if the receiver is idle.
6194  Description:
6195  This function identifies if the receiver is idle.
6196  This operation is atomic.
6197  Precondition:
6198  None.
6199  Parameters:
6200  index - Identifier for the device instance to be configured
6201  Returns:
6202  - true - The receive buffer is idle
6203  - false - The receive buffer is not idle
6204  Example:
6205  <code>
6206 #define MY_USART_INSTANCE USART_ID_1
6207  int8_t mydata;
6208  if(PLIB_USART_ReceiverIsIdle(MY_USART_INSTANCE))
6209  {
6210  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
6211  }
6212  </code>
6213  Remarks:
6214  This feature may not be available on all devices. Please refer to the
6215  specific device data sheet to determine availability or use
6216  PLIB_USART_ExistsReceiverIdleStatus in your application to determine
6217  whether this feature is available.
6218 */
6219 
6220 bool
6222  USART_MODULE_ID index ) ;
6223 //******************************************************************************
6224 /* Function:
6225  void PLIB_USART_ReceiverEnable ( USART_MODULE_ID index )
6226  Summary:
6227  Enables the USART receiver.
6228  Description:
6229  This function enables the USART receiver.
6230  This operation is atomic.
6231  Precondition:
6232  None.
6233  Parameters:
6234  index - Identifier for the device instance to be configured
6235  Returns:
6236  None.
6237  Example:
6238  <code>
6239 #define MY_USART_INSTANCE USART_ID_1
6240  PLIB_USART_ReceiverEnable(MY_USART_INSTANCE);
6241  </code>
6242  Remarks:
6243  This feature may not be available on all devices. Please refer to the
6244  specific device data sheet to determine availability or use
6245  PLIB_USART_ExistsReceiverEnable in your application to determine
6246  whether this feature is available.
6247 */
6248 
6249 void
6251  USART_MODULE_ID index ) ;
6252 //******************************************************************************
6253 /* Function:
6254  void PLIB_USART_ReceiverDisable ( USART_MODULE_ID index )
6255  Summary:
6256  Disables the USART receiver.
6257  Description:
6258  This function disables the USART receiver.
6259  This operation is atomic.
6260  Precondition:
6261  None.
6262  Parameters:
6263  index - Identifier for the device instance to be configured
6264  Returns:
6265  None.
6266  Example:
6267  <code>
6268 #define MY_USART_INSTANCE USART_ID_1
6269  PLIB_USART_ReceiverDisable(MY_USART_INSTANCE);
6270  </code>
6271  Remarks:
6272  This feature may not be available on all devices. Please refer to the
6273  specific device data sheet to determine availability or use
6274  PLIB_USART_ExistsReceiverEnable in your application to determine
6275  whether this feature is available.
6276 */
6277 
6278 void
6280  USART_MODULE_ID index ) ;
6281 //******************************************************************************
6282 /* Function:
6283  void PLIB_USART_TransmitterIdleIsLowEnable ( USART_MODULE_ID index )
6284  Summary:
6285  Enables the Transmit Idle Low state.
6286  Description:
6287  This function enables the Transmit Idle Low state. In the USART Synchronous
6288  mode, this function configures that the TX polarity, the idle state is low.
6289  When IrDA is enabled, this function sets that IrDA encoded Transmit Idle
6290  state to a '1'.
6291  This operation is atomic.
6292  Precondition:
6293  None.
6294  Parameters:
6295  index - Identifier for the device instance to be configured
6296  Returns:
6297  None.
6298  Example:
6299  <code>
6300 #define MY_USART_INSTANCE USART_ID_1
6301  PLIB_USART_TransmitterIdleIsLowEnable(MY_USART_INSTANCE);
6302  </code>
6303  Remarks:
6304  This feature may not be available on all devices. Please refer to the
6305  specific device data sheet to determine availability or use
6306  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
6307  whether this feature is available.
6308 */
6309 
6310 void
6312  USART_MODULE_ID index ) ;
6313 //******************************************************************************
6314 /* Function:
6315  void PLIB_USART_TransmitterIdleIsLowDisable ( USART_MODULE_ID index )
6316  Summary:
6317  Disables the Transmit Idle Low state.
6318  Description:
6319  This function disables the Transmit Idle Low state. In USART Synchronous mode,
6320  this function configures that the TX polarity the idle state is high.
6321  When IrDA is enabled, this function sets the IrDA encoded Transmit Idle
6322  state to a '0'.
6323  This operation is atomic.
6324  Precondition:
6325  None.
6326  Parameters:
6327  index - Identifier for the device instance to be configured
6328  Returns:
6329  None.
6330  Example:
6331  <code>
6332 #define MY_USART_INSTANCE USART_ID_1
6333  PLIB_USART_TransmitterIdleIsLowDisable(MY_USART_INSTANCE);
6334  </code>
6335  Remarks:
6336  This feature may not be available on all devices. Please refer to the
6337  specific device data sheet to determine availability or use
6338  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
6339  whether this feature is available.
6340 */
6341 
6342 void
6344  USART_MODULE_ID index ) ;
6345 //******************************************************************************
6346 /* Function:
6347  void PLIB_USART_ReceiverIdleStateLowEnable ( USART_MODULE_ID index )
6348  Summary:
6349  Enables receive polarity inversion.
6350  Description:
6351  This function enables receive polarity inversion. In the USART Synchronous mode,
6352  this function configures that the data is inverted.
6353  This operation is atomic.
6354  Precondition:
6355  None.
6356  Parameters:
6357  index - Identifier for the device instance to be configured
6358  Returns:
6359  None.
6360  Example:
6361  <code>
6362 #define MY_USART_INSTANCE USART_ID_1
6363  PLIB_USART_ReceiverIdleStateLowEnable(MY_USART_INSTANCE);
6364  </code>
6365  Remarks:
6366  This feature may not be available on all devices. Please refer to the
6367  specific device data sheet to determine availability or use
6368  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6369  whether this feature is available.
6370 */
6371 
6372 void
6374  USART_MODULE_ID index ) ;
6375 //******************************************************************************
6376 /* Function:
6377  void PLIB_USART_ReceiverIdleStateLowDisable ( USART_MODULE_ID index );
6378  Summary:
6379  Disables receive polarity inversion.
6380  This operation is atomic.
6381  Description:
6382  This function disables receive polarity inversion. In the USART Synchronous
6383  mode, this function configures that the data is not inverted.
6384  Precondition:
6385  None.
6386  Parameters:
6387  index - Identifier for the device instance to be configured
6388  Returns:
6389  None.
6390  Example:
6391  <code>
6392 #define MY_USART_INSTANCE USART_ID_1
6393  PLIB_USART_ReceiverIdleStateLowDisable(MY_USART_INSTANCE);
6394  </code>
6395  Remarks:
6396  This feature may not be available on all devices. Please refer to the
6397  specific device data sheet to determine availability or use
6398  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6399  whether this feature is available.
6400 */
6401 
6402 void
6404  USART_MODULE_ID index ) ;
6405 //******************************************************************************
6406 /* Function:
6407  void PLIB_USART_BaudRateHighEnable ( USART_MODULE_ID index )
6408  Summary:
6409  Enables high baud rate selection.
6410  Description:
6411  This function enables high baud rate selection.
6412  This operation is atomic.
6413  Precondition:
6414  None.
6415  Parameters:
6416  index - Identifier for the device instance to be configured
6417  Returns:
6418  None.
6419  Example:
6420  <code>
6421 #define MY_USART_INSTANCE USART_ID_1
6422  PLIB_USART_BaudRateHighEnable(MY_USART_INSTANCE);
6423  </code>
6424  Remarks:
6425  This feature may not be available on all devices. Please refer to the
6426  specific device data sheet to determine availability or use
6427  PLIB_USART_ExistsBaudRateHigh in your application to determine
6428  whether this feature is available.
6429 */
6430 
6431 void
6433  USART_MODULE_ID index ) ;
6434 //******************************************************************************
6435 /* Function:
6436  void PLIB_USART_BaudRateHighDisable ( USART_MODULE_ID index )
6437  Summary:
6438  Disables the high baud rate selection.
6439  Description:
6440  This function disables the high baud rate selection.
6441  This operation is atomic.
6442  Precondition:
6443  None.
6444  Parameters:
6445  index - Identifier for the device instance to be configured
6446  Returns:
6447  None.
6448  Example:
6449  <code>
6450 #define MY_USART_INSTANCE USART_ID_1
6451  PLIB_USART_BaudRateHighDisable(MY_USART_INSTANCE);
6452  </code>
6453  Remarks:
6454  This feature may not be available on all devices. Please refer to the
6455  specific device data sheet to determine availability or use
6456  PLIB_USART_ExistsBaudRateHigh in your application to determine
6457  whether this feature is available.
6458 */
6459 
6460 void
6462  USART_MODULE_ID index ) ;
6463 //******************************************************************************
6464 /* Function:
6465  void PLIB_USART_TransmitterInterruptModeSelect( USART_MODULE_ID index,
6466  USART_TRANSMIT_INTR_MODE interruptMode )
6467  Summary:
6468  Sets the USART transmitter interrupt mode.
6469  Description:
6470  This function sets the condition in which the USART module should generate
6471  an interrupt.
6472  This operation is atomic.
6473  Precondition:
6474  None.
6475  Parameters:
6476  index - Identifier for the device instance to be configured
6477  interruptMode - Interrupt mode; for possible configurations, refer to
6478  USART_TRANSMIT_INTR_MODE
6479  Returns:
6480  None.
6481  Example:
6482  <code>
6483 #define MY_USART_INSTANCE USART_ID_1
6484  PLIB_USART_TransmitterInterruptModeSelect(MY_USART_INSTANCE,
6485  USART_TRANSMIT_FIFO_EMPTY );
6486  </code>
6487  Remarks:
6488  This feature may not be available on all devices. Please refer to the
6489  specific device data sheet to determine availability or use
6490  PLIB_USART_ExistsTransmitterInterruptMode in your application to determine
6491  whether this feature is available.
6492 */
6493 
6494 void
6496  USART_MODULE_ID index ,
6497  USART_TRANSMIT_INTR_MODE fifolevel ) ;
6498 //******************************************************************************
6499 /* Function:
6500  void PLIB_USART_ReceiverInterruptModeSelect( USART_MODULE_ID index,
6501  USART_RECEIVE_INTR_MODE interruptMode )
6502  Summary:
6503  Sets the USART receiver FIFO level.
6504  Description:
6505  This function sets the USART receiver FIFO level.
6506  This operation is atomic.
6507  Precondition:
6508  None.
6509  Parameters:
6510  index - Identifier for the device instance to be configured
6511  fifolevel - For possible configurations, refer to USART_RECEIVE_INTR_MODE
6512  Returns:
6513  None.
6514  Example:
6515  <code>
6516 #define MY_USART_INSTANCE USART_ID_1
6517  PLIB_USART_ReceiverInterruptModeSelect(MY_USART_INSTANCE,
6518  USART_RECEIVE_FIFO_ONE_CHAR );
6519  </code>
6520  Remarks:
6521  This feature may not be available on all devices. Please refer to the
6522  specific device data sheet to determine availability or use
6523  PLIB_USART_ExistsReceiverInterruptMode in your application to determine
6524  whether this feature is available.
6525 */
6526 
6527 void
6529  USART_MODULE_ID index ,
6530  USART_RECEIVE_INTR_MODE interruptMode ) ;
6531 //******************************************************************************
6532 /* Function:
6533  void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index,
6534  USART_LINECONTROL_MODE dataFlowConfig)
6535  Summary:
6536  Sets the data flow configuration.
6537  Description:
6538  This function sets the USART data flow configuration based on the mask
6539  provided and the specified baud rate.
6540  Precondition:
6541  None.
6542  Parameters:
6543  index - Identifier for the device instance to be configured
6544  mode - For possible data flow configurations, refer to
6545  USART_LINECONTROL_MODE
6546  Returns:
6547  None.
6548  Example:
6549  <code>
6550 #define MY_USART_INSTANCE USART_ID_1
6551  PLIB_USART_LineControlModeSelect(MY_USART_INSTANCE, \
6552  USART_8N1);
6553  </code>
6554  Remarks:
6555  This feature may not be available on all devices. Please refer to the
6556  specific device data sheet to determine availability or use
6557  PLIB_USART_ExistsLineControlMode in your application to determine
6558  whether this feature is available.
6559 */
6560 
6561 void
6563  USART_MODULE_ID index ,
6564  USART_LINECONTROL_MODE dataFlowConfig ) ;
6565 //******************************************************************************
6566 /* Function:
6567  void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index,
6568  USART_HANDSHAKE_MODE handshakeConfig)
6569  Summary:
6570  Sets the data flow configuration.
6571  Description:
6572  This function sets the USART data flow configuration based on the mask
6573  provided and the specified baud rate.
6574  Precondition:
6575  None.
6576  Parameters:
6577  index - Identifier for the device instance to be configured
6578  mode - For possible data flow configurations, refer to
6579  USART_HANDSHAKE_MODE
6580  Returns:
6581  None.
6582  Example:
6583  <code>
6584 #define MY_USART_INSTANCE USART_ID_1
6585  PLIB_USART_HandshakeModeSelect(MY_USART_INSTANCE, \
6586  USART_HANDSHAKE_MODE_SIMPLEX);
6587  </code>
6588  Remarks:
6589  This feature may not be available on all devices. Please refer to the
6590  specific device data sheet to determine availability or use
6591  PLIB_USART_ExistsHandshakeMode in your application to determine
6592  whether this feature is available.
6593 */
6594 
6595 void
6597  USART_MODULE_ID index ,
6598  USART_HANDSHAKE_MODE handshakeConfig ) ;
6599 //******************************************************************************
6600 /* Function:
6601  void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index,
6602  int8_t Mask)
6603  Summary:
6604  Setup the automatic Address Detect mode.
6605  Description:
6606  This function configures the automatic Address Detect mode. Uses the mask as
6607  the address character for automatic address detection.
6608  This operation is atomic.
6609  Precondition:
6610  None.
6611  Parameters:
6612  index - Identifier for the device instance to be configured
6613  Mask - Address character to be used, when enabled
6614  Returns:
6615  None.
6616  Example:
6617  <code>
6618 #define MY_USART_INSTANCE USART_ID_1
6619  PLIB_USART_ReceiverAddressAutoDetectEnable(MY_USART_INSTANCE,
6620  MY_DEVICE_ADDRESS);
6621  </code>
6622  Remarks:
6623  This feature may not be available on all devices. Please refer to the
6624  specific device data sheet to determine availability or use
6625  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6626  whether this feature is available.
6627 */
6628 
6629 void
6631  USART_MODULE_ID index ,
6632  int8_t Mask ) ;
6633 //******************************************************************************
6634 /* Function:
6635  void PLIB_USART_ReceiverAddressAutoDetectDisable (
6636  USART_MODULE_ID index )
6637  Summary:
6638  Disables the automatic Address Detect mode.
6639  Description:
6640  This function disables the automatic Address Detect mode.
6641  This operation is atomic.
6642  Precondition:
6643  None.
6644  Parameters:
6645  index - Identifier for the device instance to be configured
6646  Returns:
6647  None.
6648  Example:
6649  <code>
6650 #define MY_USART_INSTANCE USART_ID_1
6651  PLIB_USART_ReceiverAddressAutoDetectDisable(MY_USART_INSTANCE);
6652  </code>
6653  Remarks:
6654  This feature may not be available on all devices. Please refer to the
6655  specific device data sheet to determine availability or use
6656  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6657  whether this feature is available.
6658 */
6659 
6660 void
6662  USART_MODULE_ID index ) ;
6663 //******************************************************************************
6664 /* Function:
6665  void PLIB_USART_IrDAEnable ( USART_MODULE_ID index )
6666  Summary:
6667  Enables the IrDA encoder and decoder.
6668  Description:
6669  This function enables the IrDA encoder and decoder.
6670  This operation is atomic.
6671  Precondition:
6672  None.
6673  Parameters:
6674  index - Identifier for the device instance to be configured
6675  Returns:
6676  None.
6677  Example:
6678  <code>
6679 #define MY_USART_INSTANCE USART_ID_1
6680  PLIB_USART_IrDAEnable(MY_USART_INSTANCE);
6681  </code>
6682  Remarks:
6683  This feature may not be available on all devices. Please refer to the
6684  specific device data sheet to determine availability or use
6685  PLIB_USART_ExistsIrDA in your application to determine
6686  whether this feature is available.
6687 */
6688 
6689 void
6691  USART_MODULE_ID index ) ;
6692 //******************************************************************************
6693 /* Function:
6694  void PLIB_USART_IrDADisable ( USART_MODULE_ID index )
6695  Summary:
6696  Disables the IrDA encoder and decoder.
6697  Description:
6698  This function disables the IrDA encoder and decoder.
6699  This operation is atomic.
6700  Precondition:
6701  None.
6702  Parameters:
6703  index - Identifier for the device instance to be configured
6704  Returns:
6705  None.
6706  Example:
6707  <code>
6708 #define MY_USART_INSTANCE USART_ID_1
6709  PLIB_USART_IrDADisable(MY_USART_INSTANCE);
6710  </code>
6711  Remarks:
6712  By default, the IrDA Encoder and Decoder are disabled.
6713 
6714  This feature may not be available on all devices. Please refer to the
6715  specific device data sheet to determine availability or use
6716  PLIB_USART_ExistsIrDA in your application to determine
6717  whether this feature is available.
6718 */
6719 
6720 void
6722  USART_MODULE_ID index ) ;
6723 //******************************************************************************
6724 /* Function:
6725  void PLIB_USART_LoopbackEnable ( USART_MODULE_ID index )
6726  Summary:
6727  Enables Loopback mode.
6728  Description:
6729  This function enables Loopback mode.
6730  This operation is atomic.
6731  Precondition:
6732  None.
6733  Parameters:
6734  index - Identifier for the device instance to be configured
6735  Returns:
6736  None.
6737  Example:
6738  <code>
6739 #define MY_USART_INSTANCE USART_ID_1
6740  PLIB_USART_LoopbackEnable(MY_USART_INSTANCE);
6741  </code>
6742  Remarks:
6743  By default, Loopback mode is disabled.
6744 
6745  This feature may not be available on all devices. Please refer to the
6746  specific device data sheet to determine availability or use
6747  PLIB_USART_ExistsLoopback in your application to determine
6748  whether this feature is available.
6749 */
6750 
6751 void
6753  USART_MODULE_ID index ) ;
6754 //******************************************************************************
6755 /* Function:
6756  void PLIB_USART_LoopbackDisable ( USART_MODULE_ID index )
6757  Summary:
6758  Disables Loopback mode.
6759  Description:
6760  This function disables Loopback mode.
6761  This operation is atomic.
6762  Precondition:
6763  None.
6764  Parameters:
6765  index - Identifier for the device instance to be configured
6766  Returns:
6767  None.
6768  Example:
6769  <code>
6770 #define MY_USART_INSTANCE USART_ID_1
6771  PLIB_USART_LoopbackDisable(MY_USART_INSTANCE);
6772  </code>
6773  Remarks:
6774  By default, Loopback mode is disabled.
6775  This feature may not be available on all devices. Please refer to the
6776  specific device data sheet to determine availability or use
6777  PLIB_USART_ExistsLoopback in your application to determine
6778  whether this feature is available.
6779 */
6780 
6781 void
6783  USART_MODULE_ID index ) ;
6784 //******************************************************************************
6785 /* Function:
6786  void PLIB_USART_OperationModeSelect(USART_MODULE_ID index,
6787  USART_OPERATION_MODE operationmode)
6788  Summary:
6789  Configures the operation mode of the USART module.
6790  Description:
6791  This function configures the operation mode of the USART (i.e., controls the
6792  pins used by the USART module). Refer to USART_OPERATION_MODE for the
6793  possible settings.
6794  Precondition:
6795  None.
6796  Parameters:
6797  index - Identifier for the device instance to be configured
6798  operationmode - One of the possible values from USART_OPERATION_MODE
6799  Returns:
6800  None.
6801  Example:
6802  <code>
6803 #define MY_USART_INSTANCE USART_ID_1
6804  PLIB_USART_OperationModeSelect(MY_USART_INSTANCE, USART_ENABLE_TX_RX_BCLK_USED);
6805  </code>
6806  Remarks:
6807  This feature may not be available on all devices. Please refer to the
6808  specific device data sheet to determine availability or use
6809  PLIB_USART_ExistsOperationMode in your application to determine
6810  whether this feature is available.
6811 */
6812 
6813 void
6815  USART_MODULE_ID index ,
6816  USART_OPERATION_MODE operationmode ) ;
6817 //******************************************************************************
6818 /* Function:
6819  void PLIB_USART_StopInIdleEnable ( USART_MODULE_ID index )
6820  Summary:
6821  Discontinues operation when the device enters Idle mode.
6822  Description:
6823  This function enables the USART module to discontinue operation when the
6824  device enters Idle mode.
6825  This operation is atomic.
6826  Precondition:
6827  None.
6828  Parameters:
6829  index - Identifier for the device instance to be configured
6830  Returns:
6831  None.
6832  Example:
6833  <code>
6834 #define MY_USART_INSTANCE USART_ID_1
6835  PLIB_USART_StopInIdleEnable(MY_USART_INSTANCE);
6836  </code>
6837  Remarks:
6838  This feature may not be available on all devices. Please refer to the
6839  specific device data sheet to determine availability or use
6840  PLIB_USART_ExistsStopInIdle in your application to determine
6841  whether this feature is available.
6842 */
6843 
6844 void
6846  USART_MODULE_ID index ) ;
6847 //******************************************************************************
6848 /* Function:
6849  void PLIB_USART_StopInIdleDisable ( USART_MODULE_ID index )
6850  Summary:
6851  Disables the Stop in Idle mode (the USART module continues operation when
6852  the device is in Idle mode).
6853  Description:
6854  This function disables the Stop in Idle mode. The USART module continues
6855  operation when the device is in Idle mode.
6856  This operation is atomic.
6857  Precondition:
6858  None.
6859  Parameters:
6860  index - Identifier for the device instance to be configured
6861  Returns:
6862  None.
6863  Example:
6864  <code>
6865 #define MY_USART_INSTANCE USART_ID_1
6866  PLIB_USART_StopInIdleDisable(MY_USART_INSTANCE);
6867  </code>
6868  Remarks:
6869  By default, the USART module will continue operation in Idle mode.
6870 
6871  This feature may not be available on all devices. Please refer to the
6872  specific device data sheet to determine availability or use
6873  PLIB_USART_ExistsStopInIdle in your application to determine
6874  whether this feature is available.
6875 */
6876 
6877 void
6879  USART_MODULE_ID index ) ;
6880 //******************************************************************************
6881 /* Function:
6882  void PLIB_USART_WakeOnStartEnable ( USART_MODULE_ID index )
6883  Summary:
6884  Enables the wake-up on start bit detection feature during Sleep mode.
6885  Description:
6886  This function enables the wake-up on start feature during Sleep mode.
6887  This operation is atomic.
6888  Precondition:
6889  None.
6890  Parameters:
6891  index - Identifier for the device instance to be configured
6892  Returns:
6893  None.
6894  Example:
6895  <code>
6896 #define MY_USART_INSTANCE USART_ID_1
6897  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6898  </code>
6899  Remarks:
6900  This feature may not be available on all devices. Please refer to the
6901  specific device data sheet to determine availability or use
6902  PLIB_USART_ExistsWakeOnStart in your application to determine
6903  whether this feature is available.
6904 */
6905 
6906 void
6908  USART_MODULE_ID index ) ;
6909 //******************************************************************************
6910 /* Function:
6911  void PLIB_USART_WakeOnStartDisable ( USART_MODULE_ID index )
6912  Summary:
6913  Disables the wake-up on start bit detection feature during Sleep mode.
6914  Description:
6915  This function disables the wake-up on start bit detection feature during
6916  Sleep mode.
6917  This operation is atomic.
6918  Precondition:
6919  None.
6920  Parameters:
6921  index - Identifier for the device instance to be configured
6922  Returns:
6923  None.
6924  Example:
6925  <code>
6926 #define MY_USART_INSTANCE USART_ID_1
6927  PLIB_USART_WakeOnStartDisable(MY_USART_INSTANCE);
6928  </code>
6929  Remarks:
6930  This feature may not be available on all devices. Please refer to the
6931  specific device data sheet to determine availability or use
6932  PLIB_USART_ExistsWakeOnStart in your application to determine
6933  whether this feature is available.
6934 */
6935 
6936 void
6938  USART_MODULE_ID index ) ;
6939 //******************************************************************************
6940 /* Function:
6941  bool PLIB_USART_WakeOnStartIsEnabled ( USART_MODULE_ID index )
6942  Summary:
6943  Gets the state of the sync break event completion.
6944  Description:
6945  This function returns the status of the sync break event, when called
6946  after enabling using PLIB_USART_WakeOnStartEnable.
6947  This operation is atomic.
6948  Precondition:
6949  None.
6950  Parameters:
6951  index - Identifier for the device instance to be configured
6952  Returns:
6953  None.
6954  Example:
6955  <code>
6956 #define MY_USART_INSTANCE USART_ID_1
6957  //Call the interface just prior to entering the sleep mode.
6958  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6959  // Check the status if the Sync break event is over.
6960  if(PLIB_USART_WakeOnStartIsEnabled(MY_USART_INSTANCE))
6961  {
6962  // Do Something
6963  }
6964  </code>
6965  Remarks:
6966  This feature may not be available on all devices. Please refer to the
6967  specific device data sheet to determine availability or use
6968  PLIB_USART_ExistsWakeOnStart in your application to determine
6969  whether this feature is available.
6970 */
6971 
6972 bool
6974  USART_MODULE_ID index ) ;
6975 //******************************************************************************
6976 /* Function:
6977  void PLIB_USART_InitializeModeGeneral( USART_MODULE_ID index, bool autobaud,
6978  bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle );
6979  Summary:
6980  Enables or disables general features of the USART module.
6981  Description:
6982  This function enables or disables general features of the USART module.
6983  Precondition:
6984  None.
6985  Parameters:
6986  index - Identifier for the device instance to be configured
6987  autobaud - If true, auto baud rate detection is enabled. If false
6988  the feature is disabled.
6989  loopBackMode - If true, loop back is enabled. If false the feature is
6990  disabled.
6991  wakeFromSleep - If true, the USART module will wake up the CPU from sleep
6992  mode on USART activity. If false the feature is disabled.
6993  irdaMode - If true, the IrDA mode is enabled. If false the feature
6994  is disabled.
6995  stopInIdle - If true, module will stop functioning when CPU enters Idle
6996  mode. If false, the feature is disabled.
6997  Returns:
6998  None.
6999  Example:
7000  <code>
7001 #define MY_USART_INSTANCE USART_ID_1
7002  // Enable loopback, disable IrDA, disable auto baud detection and disable
7003  // wake from sleep. Enable stop in idle
7004  PLIB_USART_InitializeModeGeneral(MY_USART_INSTANCE, false, true,
7005  false, false, true);
7006  </code>
7007  Remarks:
7008  Enabling the wake from sleep feature will cause the first character that is
7009  received by the USART module to be discarded. This feature should only be
7010  enabled if the CPU is to placed in power saving mode.
7011 
7012  This feature may not be available on all devices. Please refer to the
7013  specific device data sheet to determine availability. Availability of this
7014  function can also be determined if all of the following functions return
7015  true:
7016  - PLIB_USART_ExistsLoopback
7017  - PLIB_USART_ExistsBaudRateAutoDetect
7018  - PLIB_USART_ExistsWakeOnStart
7019  - PLIB_USART_ExistsIrDA
7020  - PLIB_USART_ExistsStopInIdle
7021 */
7022 
7023 void
7025  USART_MODULE_ID index ,
7026  bool autobaud ,
7027  bool loopBackMode ,
7028  bool wakeFromSleep ,
7029  bool irdaMode ,
7030  bool stopInIdle ) ;
7031 //******************************************************************************
7032 /* Function:
7033  void PLIB_USART_InitializeOperation( USART_MODULE_ID index ,
7034  USART_RECEIVE_INTR_MODE receiveInterruptMode,
7035  USART_TRANSMIT_INTR_MODE transmitInterruptMode,
7036  USART_OPERATION_MODE operationMode);
7037  Summary:
7038  Configures the Receive and Transmit FIFO interrupt levels and the hardware
7039  lines to be used by the module.
7040  Description:
7041  This function configures the Receive and Transmit FIFO interrupt levels and
7042  the hardware lines to be used by the module.
7043  Precondition:
7044  None.
7045  Parameters:
7046  index - Identifier for the device instance to be configured
7047  receiveInterruptMode - Receiver FIFO interrupt level
7048  transmitInterruptMode - Transmit FIFO interrupt level
7049  operationMode - Hardware lines to be used by the USART.
7050  Returns:
7051  None.
7052  Example:
7053  <code>
7054 #define MY_USART_INSTANCE USART_ID_1
7055  // Set receive FIFO to interrupt when FIFO is 3/4 level full
7056  // Set Transmit FIFO to interrupt when FIFO is empty
7057  // USART module will only use RX and TX hardware lines
7058  PLIB_USART_InitializeOperation(MY_USART_INSTANCE, USART_RECEIVE_FIFO_3B4FULL,
7059  USART_TRANSMIT_FIFO_EMPTY , USART_ENABLE_TX_RX_USED);
7060  </code>
7061  Remarks:
7062  This feature may not be available on all devices. Please refer to the
7063  specific device data sheet to determine availability. Availability of this
7064  function can also be determined if all of the following functions return
7065  true:
7066  - PLIB_USART_ExistsReceiverInterruptMode
7067  - PLIB_USART_ExistsTransmitterInterruptMode
7068  - PLIB_USART_ExistsOperationMode
7069 */
7070 
7071 void
7073  USART_MODULE_ID index ,
7074  USART_RECEIVE_INTR_MODE receiveInterruptMode ,
7075  USART_TRANSMIT_INTR_MODE transmitInterruptMode ,
7076  USART_OPERATION_MODE operationMode ) ;
7077 //******************************************************************************
7078 /* Function:
7079  void PLIB_USART_BaudSetAndEnable ( USART_MODULE_ID index, uint32_t
7080  clockFrequency, uint32_t baudRate );
7081  Summary:
7082  Sets the baud rate to the desired value and enables the USART receiver,
7083  transmitter and the USART module.
7084  Description:
7085  This function sets the baud rate to the desired value and enables the USART
7086  receiver, USART transmitter and USART module.
7087  Precondition:
7088  None.
7089  Parameters:
7090  index - Identifier for the device instance to be configured
7091  baudRate - Baud Rate Value
7092  clockFrequency - Clock Frequency
7093  Returns:
7094  None.
7095  Example:
7096  <code>
7097 #define MY_USART_INSTANCE USART_ID_1
7098  uint32_t baudRateValue ;
7099  PLIB_USART_BaudSetAndEnable(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
7100  </code>
7101  Remarks:
7102  Setting a new baud rate value causes the baud rate timer to reset.
7103  This ensures that the baud rate timer does not have to overflow before
7104  outputting the new baud rate.
7105 
7106  If the system clock is changed during an active receive operation, a
7107  receiver error or data loss may result. To avoid this issue verify that
7108  no receptions are in progress before changing the system clock.
7109 
7110  This feature may not be available on all devices. Please refer to the
7111  specific device data sheet to determine availability. Availability of this
7112  function can also be determined if all of the following functions return
7113  true:
7114  - PLIB_USART_ExistsBaudRate
7115  - PLIB_USART_ExistsTransmitterEnable
7116  - PLIB_USART_ExistsReceiverEnable
7117  - PLIB_USART_ExistsEnable
7118 */
7119 
7120 void
7122  USART_MODULE_ID index ,
7123  uint32_t systemClock ,
7124  uint32_t baud ) ;
7125 //******************************************************************************
7126 /* Function:
7127  USART_ERROR PLIB_USART_ErrorsGet ( USART_MODULE_ID index )
7128  Summary:
7129  Return the status of all errors in the specified USART module.
7130  Description:
7131  This function returns status of all errors in the specified USART module.
7132  The return value can be bitwise AND'ed with a USART_ERROR type to know the
7133  status of a specific error.
7134  This operation is atomic.
7135  Precondition:
7136  None.
7137  Parameters:
7138  index - Identifier for the device instance to be configured
7139  Returns:
7140  Returns a bitmap of USART error status.
7141  Example:
7142  <code>
7143 #define MY_USART_INSTANCE USART_ID_1
7144  USART_ERROR error;
7145  // Get the status of all errors.
7146  error = PLIB_USART_ErrorsGet(MY_USART_INSTANCE);
7147  // Check if parity error is active
7148  if(error & USART_ERROR_PARITY)
7149  {
7150  // Parity error is active.
7151  }
7152  else if(error & USART_ERROR_FRAMING)
7153  {
7154  // Framing error is active.
7155  }
7156  </code>
7157  Remarks:
7158  This feature may not be available on all devices. Please refer to the
7159  specific device data sheet to determine availability. Availability of this
7160  function can also be determined if all of the followings functions return
7161  true:
7162  - PLIB_USART_ExistsReceiverFramingErrorStatus
7163  - PLIB_USART_ExistsReceiverParityErrorStatus
7164  - PLIB_USART_ExistsReceiverOverrunStatus
7165 */
7166 
7167 USART_ERROR
7169  USART_MODULE_ID index ) ;
7170 //******************************************************************************
7171 /* Function:
7172  PLIB_USART_TransmitterAddressGet( USART_MODULE_ID index )
7173  Summary:
7174  Returns the address of the USART TX register
7175  Description:
7176  This function returns the address of the USART TX register.
7177  This operation is atomic.
7178  Preconditions:
7179  None.
7180  Parameters:
7181  index - Identifier for the device instance
7182  Returns:
7183  Address of the USART TX register
7184  Remarks:
7185  None.
7186 */
7187 
7188 void *
7190  USART_MODULE_ID index ) ;
7191 //******************************************************************************
7192 /* Function:
7193  PLIB_USART_ReceiverAddressGet( USART_MODULE_ID index )
7194  Summary:
7195  Returns the address of the USART RX register
7196  Description:
7197  This function returns the address of the USART RX register.
7198  This operation is atomic.
7199  Preconditions:
7200  None.
7201  Parameters:
7202  index - Identifier for the device instance
7203  Returns:
7204  Address of the USART RX register
7205  Remarks:
7206  None.
7207 */
7208 
7209 void *
7211  USART_MODULE_ID index ) ;
7212 // *****************************************************************************
7213 // *****************************************************************************
7214 // Section: USART Peripheral Library Exists Functions
7215 // *****************************************************************************
7216 // *****************************************************************************
7217 /* The following functions indicate the existence of the features on the device.
7218 */
7219 //******************************************************************************
7220 /* Function:
7221  PLIB_USART_ExistsRunInOverflow ( USART_MODULE_ID index )
7222  Summary:
7223  Identifies whether the Run in overflow condition feature exists on the USART module.
7224  Description:
7225  This function identifies whether the Run in Overflow condition feature is
7226  available on the USART module. When this function returns true, these
7227  functions are supported on the device:
7228  - PLIB_USART_RunInOverflowEnable
7229  - PLIB_USART_RunInOverflowDisable
7230  - PLIB_USART_RunInOverflowIsEnabled
7231  This operation is atomic.
7232  Preconditions:
7233  None.
7234  Parameters:
7235  index - Identifier for the device instance
7236  Returns:
7237  - true - The Run in Overflow condition feature is supported on the device
7238  - false - The Run in Overflow condition feature is not supported on the device
7239  Remarks:
7240  None.
7241 */
7242 
7243 bool
7245  USART_MODULE_ID index ) ;
7246 //******************************************************************************
7247 /* Function:
7248  PLIB_USART_ExistsBRGClockSourceSelect ( USART_MODULE_ID index )
7249  Summary:
7250  Identifies whether the BRG Clock source select feature exists on the
7251  USART module.
7252  Description:
7253  This function identifies whether the BRG Clock source select feature is
7254  available on the USART module. When this function returns true, these
7255  functions are supported on the device:
7256  - PLIB_USART_BRGClockSourceSelect
7257  - PLIB_USART_BRGClockSourceGet
7258  This operation is atomic.
7259  Preconditions:
7260  None.
7261  Parameters:
7262  index - Identifier for the device instance
7263  Returns:
7264  - true - The BRG clock source select feature is supported on the device
7265  - false - The BRG clock source select feature is not supported on the device
7266  Remarks:
7267  None.
7268 */
7269 
7270 bool
7272  USART_MODULE_ID index ) ;
7273 //******************************************************************************
7274 /* Function:
7275  PLIB_USART_ExistsModuleBusyStatus ( USART_MODULE_ID index )
7276  Summary:
7277  Identifies whether the module running status feature exists on the
7278  USART module.
7279  Description:
7280  This function identifies whether the module running status feature is
7281  available on the USART module. When this function returns true, this
7282  function is supported on the device:
7283  - PLIB_USART_ModuleIsBusy
7284  This operation is atomic.
7285  Preconditions:
7286  None.
7287  Parameters:
7288  index - Identifier for the device instance
7289  Returns:
7290  - true - The Module running status feature is supported on the device
7291  - false - The Module running status feature is not supported on the device
7292  Remarks:
7293  None.
7294 */
7295 
7296 bool
7298  USART_MODULE_ID index ) ;
7299 //******************************************************************************
7300 /* Function:
7301  PLIB_USART_ExistsRunInSleepMode ( USART_MODULE_ID index )
7302  Summary:
7303  Identifies whether the Run in Sleep mode feature exists on the USART module.
7304  Description:
7305  This function identifies whether the Run in Sleep mode feature is
7306  available on the USART module. When this function returns true, these
7307  functions are supported on the device:
7308  - PLIB_USART_RunInSleepModeEnable
7309  - PLIB_USART_RunInSleepModeDisable
7310  - PLIB_USART_RunInSleepModeIsEnabled
7311  This operation is atomic.
7312  Preconditions:
7313  None.
7314  Parameters:
7315  index - Identifier for the device instance
7316  Returns:
7317  - true - The Run in Sleep mode feature is supported on the device
7318  - false - The Run in Sleep mode feature is not supported on the device
7319  Remarks:
7320  None.
7321 */
7322 
7323 bool
7325  USART_MODULE_ID index ) ;
7326 //******************************************************************************
7327 /* Function:
7328  PLIB_USART_ExistsEnable( USART_MODULE_ID index )
7329  Summary:
7330  Identifies whether the EnableControl feature exists on the USART module.
7331  Description:
7332  This function identifies whether the EnableControl feature is
7333  available on the USART module. When this function returns true, these
7334  functions are supported on the device:
7335  - PLIB_USART_Disable
7336  - PLIB_USART_Enable
7337  This operation is atomic.
7338  Preconditions:
7339  None.
7340  Parameters:
7341  index - Identifier for the device instance
7342  Returns:
7343  - true - The EnableControl feature is supported on the device
7344  - false - The EnableControl feature is not supported on the device
7345  Remarks:
7346  None.
7347 */
7348 
7349 bool
7351  USART_MODULE_ID index ) ;
7352 //******************************************************************************
7353 /* Function:
7354  PLIB_USART_ExistsHandshakeMode( USART_MODULE_ID index )
7355  Summary:
7356  Identifies whether the HandShakeMode feature exists on the USART module.
7357  Description:
7358  This function identifies whether the HandShakeMode feature is
7359  available on the USART module. When this function returns true, this
7360  function is supported on the device:
7361  - PLIB_USART_HandshakeModeSelect
7362  This operation is atomic.
7363  Preconditions:
7364  None.
7365  Parameters:
7366  index - Identifier for the device instance
7367  Returns:
7368  - true - The HandShakeMode feature is supported on the device
7369  - false - The HandShakeMode feature is not supported on the device
7370  Remarks:
7371  None.
7372 */
7373 
7374 bool
7376  USART_MODULE_ID index ) ;
7377 //******************************************************************************
7378 /* Function:
7379  PLIB_USART_ExistsIrDA( USART_MODULE_ID index )
7380  Summary:
7381  Identifies whether the IrDAControl feature exists on the USART module.
7382  Description:
7383  This function identifies whether the IrDAControl feature is
7384  available on the USART module. When this function returns true, these
7385  functions are supported on the device:
7386  - PLIB_USART_IrDADisable
7387  - PLIB_USART_IrDAEnable
7388  This operation is atomic.
7389  Preconditions:
7390  None.
7391  Parameters:
7392  index - Identifier for the device instance
7393  Returns:
7394  - true - The IrDAControl feature is supported on the device
7395  - false - The IrDAControl feature is not supported on the device
7396  Remarks:
7397  None.
7398 */
7399 
7400 bool
7402  USART_MODULE_ID index ) ;
7403 //******************************************************************************
7404 /* Function:
7405  PLIB_USART_ExistsLineControlMode( USART_MODULE_ID index )
7406  Summary:
7407  Identifies whether the LineControlMode feature exists on the USART module.
7408  Description:
7409  This function identifies whether the LineControlMode feature is
7410  available on the USART module. When this function returns true, this
7411  function is supported on the device:
7412  - PLIB_USART_LineControlModeSelect
7413  This operation is atomic.
7414  Preconditions:
7415  None.
7416  Parameters:
7417  index - Identifier for the device instance
7418  Returns:
7419  - true - The LineControlMode feature is supported on the device
7420  - false - The LineControlMode feature is not supported on the device
7421  Remarks:
7422  None.
7423 */
7424 
7425 bool
7427  USART_MODULE_ID index ) ;
7428 //******************************************************************************
7429 /* Function:
7430  PLIB_USART_ExistsLoopback( USART_MODULE_ID index )
7431  Summary:
7432  Identifies whether the Loopback feature exists on the USART module.
7433  Description:
7434  This function identifies whether the Loopback feature is
7435  available on the USART module. When this function returns true, these
7436  functions are supported on the device:
7437  - PLIB_USART_LoopbackEnable
7438  - PLIB_USART_LoopbackDisable
7439  This operation is atomic.
7440  Preconditions:
7441  None.
7442  Parameters:
7443  index - Identifier for the device instance
7444  Returns:
7445  - true - The Loopback feature is supported on the device
7446  - false - The Loopback feature is not supported on the device
7447  Remarks:
7448  None.
7449 */
7450 
7451 bool
7453  USART_MODULE_ID index ) ;
7454 //******************************************************************************
7455 /* Function:
7456  PLIB_USART_ExistsOperationMode( USART_MODULE_ID index )
7457  Summary:
7458  Identifies whether the OperationMode feature exists on the USART module.
7459  Description:
7460  This function identifies whether the OperationMode feature is
7461  available on the USART module. When this function returns true, this
7462  function is supported on the device:
7463  - PLIB_USART_OperationModeSelect
7464  This operation is atomic.
7465  Preconditions:
7466  None.
7467  Parameters:
7468  index - Identifier for the device instance
7469  Returns:
7470  - true - The OperationMode feature is supported on the device
7471  - false - The OperationMode feature is not supported on the device
7472  Remarks:
7473  None.
7474 */
7475 
7476 bool
7478  USART_MODULE_ID index ) ;
7479 //******************************************************************************
7480 /* Function:
7481  PLIB_USART_ExistsStopInIdle( USART_MODULE_ID index )
7482  Summary:
7483  Identifies whether the StopInIdle feature exists on the USART module.
7484  Description:
7485  This function identifies whether the StopInIdle feature is
7486  available on the USART module. When this function returns true, these
7487  functions are supported on the device:
7488  - PLIB_USART_StopInIdleEnable
7489  - PLIB_USART_StopInIdleDisable
7490  This operation is atomic.
7491  Preconditions:
7492  None.
7493  Parameters:
7494  index - Identifier for the device instance
7495  Returns:
7496  - true - The StopInIdle feature is supported on the device
7497  - false - The StopInIdle feature is not supported on the device
7498  Remarks:
7499  None.
7500 */
7501 
7502 bool
7504  USART_MODULE_ID index ) ;
7505 //******************************************************************************
7506 /* Function:
7507  PLIB_USART_ExistsWakeOnStart( USART_MODULE_ID index )
7508  Summary:
7509  Identifies whether the WakeOnStart feature exists on the USART module.
7510  Description:
7511  This function identifies whether the WakeOnStart feature is
7512  available on the USART module. When this function returns true, these
7513  functions are supported on the device:
7514  - PLIB_USART_WakeOnStartEnable
7515  - PLIB_USART_WakeOnStartDisable
7516  - PLIB_USART_WakeOnStartIsEnabled
7517  This operation is atomic.
7518  Preconditions:
7519  None.
7520  Parameters:
7521  index - Identifier for the device instance
7522  Returns:
7523  - true - The WakeOnStart feature is supported on the device
7524  - false - The WakeOnStart feature is not supported on the device
7525  Remarks:
7526  None.
7527 */
7528 
7529 bool
7531  USART_MODULE_ID index ) ;
7532 //******************************************************************************
7533 /* Function:
7534  PLIB_USART_ExistsBaudRate( USART_MODULE_ID index )
7535  Summary:
7536  Identifies whether the BaudRate feature exists on the USART module.
7537  Description:
7538  This function identifies whether the BaudRate feature is
7539  available on the USART module. When this function returns true, these
7540  functions are supported on the device:
7541  - PLIB_USART_BaudRateSet
7542  - PLIB_USART_BaudRateGet
7543  This operation is atomic.
7544  Preconditions:
7545  None.
7546  Parameters:
7547  index - Identifier for the device instance
7548  Returns:
7549  - true - The BaudRate feature is supported on the device
7550  - false - The BaudRate feature is not supported on the device
7551  Remarks:
7552  None.
7553 */
7554 
7555 bool
7557  USART_MODULE_ID index ) ;
7558 //******************************************************************************
7559 /* Function:
7560  PLIB_USART_ExistsBaudRateAutoDetect( USART_MODULE_ID index )
7561  Summary:
7562  Identifies whether the BaudRateAutoDetect feature exists on the USART module.
7563  Description:
7564  This function identifies whether the BaudRateAutoDetect feature is
7565  available on the USART module. When this function returns true, these
7566  functions are supported on the device:
7567  - PLIB_USART_BaudRateAutoDetectEnable
7568  - PLIB_USART_BaudRateAutoDetectIsComplete
7569  This operation is atomic.
7570  Preconditions:
7571  None.
7572  Parameters:
7573  index - Identifier for the device instance
7574  Returns:
7575  - true - The BaudRateAutoDetect feature is supported on the device
7576  - false - The BaudRateAutoDetect feature is not supported on the device
7577  Remarks:
7578  None.
7579 */
7580 
7581 bool
7583  USART_MODULE_ID index ) ;
7584 //******************************************************************************
7585 /* Function:
7586  PLIB_USART_ExistsBaudRateHigh( USART_MODULE_ID index )
7587  Summary:
7588  Identifies whether the BaudRateHigh feature exists on the USART module.
7589  Description:
7590  This function identifies whether the BaudRateHigh feature is
7591  available on the USART module. When this function returns true, these
7592  functions are supported on the device:
7593  - PLIB_USART_BaudRateHighSet
7594  - PLIB_USART_BaudRateHighDisable
7595  - PLIB_USART_BaudRateHighEnable
7596  This operation is atomic.
7597  Preconditions:
7598  None.
7599  Parameters:
7600  index - Identifier for the device instance
7601  Returns:
7602  - true - The BaudRateHigh feature is supported on the device
7603  - false - The BaudRateHigh feature is not supported on the device
7604  Remarks:
7605  None.
7606 */
7607 
7608 bool
7610  USART_MODULE_ID index ) ;
7611 //******************************************************************************
7612 /* Function:
7613  PLIB_USART_ExistsReceiverAddress ( USART_MODULE_ID index )
7614  Summary:
7615  Identifies whether the Receiver Address feature exists on the USART
7616  module.
7617  Description:
7618  This function identifies whether the Receiver Address feature is
7619  available on the USART module. When this function returns true, these
7620  functions are supported on the device:
7621  - PLIB_USART_AddressSet
7622  - PLIB_USART_AddressGet
7623  This operation is atomic.
7624  Preconditions:
7625  None.
7626  Parameters:
7627  index - Identifier for the device instance
7628  Returns:
7629  - true - The Receiver address feature is supported on the device
7630  - false - The Receiver address feature is not supported on the device
7631  Remarks:
7632  None.
7633 */
7634 
7635 bool
7637  USART_MODULE_ID index ) ;
7638 //******************************************************************************
7639 /* Function:
7640  PLIB_USART_ExistsReceiverAddressMask ( USART_MODULE_ID index )
7641  Summary:
7642  Identifies whether the Receiver Address Mask feature exists on the USART
7643  module.
7644  Description:
7645  This function identifies whether the Receiver Address Mask feature is
7646  available on the USART module. When this function returns true, these
7647  functions are supported on the device:
7648  - PLIB_USART_AddressMaskSet
7649  - PLIB_USART_AddressMaskGet
7650  This operation is atomic.
7651  Preconditions:
7652  None.
7653  Parameters:
7654  index - Identifier for the device instance
7655  Returns:
7656  - true - The Receiver address mask feature is supported on the device
7657  - false - The Receiver address mask feature is not supported on the device
7658  Remarks:
7659  None.
7660 */
7661 
7662 bool
7664  USART_MODULE_ID index ) ;
7665 //******************************************************************************
7666 /* Function:
7667  PLIB_USART_ExistsReceiver( USART_MODULE_ID index )
7668  Summary:
7669  Identifies whether the Receiver feature exists on the USART module.
7670  Description:
7671  This function identifies whether the Receiver feature is available on the
7672  USART module. When this function returns true, these functions are supported
7673  on the device:
7674  - PLIB_USART_ReceiverByteReceive
7675  - PLIB_USART_ReceiverAddressGet
7676  This operation is atomic.
7677  Preconditions:
7678  None.
7679  Parameters:
7680  index - Identifier for the device instance
7681  Returns:
7682  - true - The Receiver feature is supported on the device
7683  - false - The Receiver feature is not supported on the device
7684  Remarks:
7685  None.
7686 */
7687 
7688 bool
7690  USART_MODULE_ID index ) ;
7691 //******************************************************************************
7692 /* Function:
7693  PLIB_USART_ExistsReceiver9Bits ( USART_MODULE_ID index )
7694  Summary:
7695  Identifies whether the 9 Bits Receiver feature exists on the USART module.
7696  Description:
7697  This function identifies whether the 9 Bits Receiver feature is available on the
7698  USART module. When this function returns true, this function is supported
7699  on the device:
7700  - PLIB_USART_Receiver9BitsReceive
7701  This operation is atomic.
7702  Preconditions:
7703  None.
7704  Parameters:
7705  index - Identifier for the device instance
7706  Returns:
7707  - true - The feature is supported on the device
7708  - false - The feature is not supported on the device
7709  Remarks:
7710  None.
7711 */
7712 
7713 bool
7715  USART_MODULE_ID index ) ;
7716 //******************************************************************************
7717 /* Function:
7718  PLIB_USART_ExistsReceiverAddressAutoDetect( USART_MODULE_ID index )
7719  Summary:
7720  Identifies whether the ReceiverAddressAutoDetect feature exists on the USART module.
7721  Description:
7722  This function identifies whether the ReceiverAddressAutoDetect feature is
7723  available on the USART module. When this function returns true, these
7724  functions are supported on the device:
7725  - PLIB_USART_ReceiverAddressAutoDetectEnable
7726  - PLIB_USART_ReceiverAddressAutoDetectDisable
7727  This operation is atomic.
7728  Preconditions:
7729  None.
7730  Parameters:
7731  index - Identifier for the device instance
7732  Returns:
7733  - true - The ReceiverAddressAutoDetect feature is supported on the device
7734  - false - The ReceiverAddressAutoDetect feature is not supported on the device
7735  Remarks:
7736  None.
7737 */
7738 
7739 bool
7741  USART_MODULE_ID index ) ;
7742 //******************************************************************************
7743 /* Function:
7744  PLIB_USART_ExistsReceiverAddressDetect( USART_MODULE_ID index )
7745  Summary:
7746  Identifies whether the ReceiverAddressDetect feature exists on the USART module.
7747  Description:
7748  This function identifies whether the ReceiverAddressDetect feature is
7749  available on the USART module. When this function returns true, these
7750  functions are supported on the device:
7751  - PLIB_USART_ReceiverAddressDetectEnable
7752  - PLIB_USART_ReceiverAddressDetectDisable
7753  - PLIB_USART_ReceiverAddressIsReceived
7754  This operation is atomic.
7755  Preconditions:
7756  None.
7757  Parameters:
7758  index - Identifier for the device instance
7759  Returns:
7760  - true - The ReceiverAddressDetect feature is supported on the device
7761  - false - The ReceiverAddressDetect feature is not supported on the device
7762  Remarks:
7763  None.
7764 */
7765 
7766 bool
7768  USART_MODULE_ID index ) ;
7769 //******************************************************************************
7770 /* Function:
7771  PLIB_USART_ExistsReceiverDataAvailableStatus( USART_MODULE_ID index )
7772  Summary:
7773  Identifies whether the ReceiverDataAvailable feature exists on the USART
7774  module
7775  Description:
7776  This function identifies whether the ReceiverDataAvailable feature is
7777  available on the USART module. When this function returns true, this
7778  function is supported on the device:
7779  - PLIB_USART_ReceiverDataIsAvailable
7780  This operation is atomic.
7781  Preconditions:
7782  None.
7783  Parameters:
7784  index - Identifier for the device instance
7785  Returns:
7786  - true - The ReceiverDataAvailable feature is supported on the device
7787  - false - The ReceiverDataAvailable feature is not supported on the device
7788  Remarks:
7789  None.
7790 */
7791 
7792 bool
7794  USART_MODULE_ID index ) ;
7795 //******************************************************************************
7796 /* Function:
7797  PLIB_USART_ExistsReceiverEnable( USART_MODULE_ID index )
7798  Summary:
7799  Identifies whether the ReceiverEnableControl feature exists on the USART module.
7800  Description:
7801  This function identifies whether the ReceiverEnableControl feature is
7802  available on the USART module. When this function returns true, these
7803  functions are supported on the device:
7804  - PLIB_USART_ReceiverEnable
7805  - PLIB_USART_ReceiverDisable
7806  This operation is atomic.
7807  Preconditions:
7808  None.
7809  Parameters:
7810  index - Identifier for the device instance
7811  Returns:
7812  - true - The ReceiverEnableControl feature is supported on the device
7813  - false - The ReceiverEnableControl feature is not supported on the device
7814  Remarks:
7815  None.
7816 */
7817 
7818 bool
7820  USART_MODULE_ID index ) ;
7821 //******************************************************************************
7822 /* Function:
7823  PLIB_USART_ExistsReceiverIdleStatus( USART_MODULE_ID index )
7824  Summary:
7825  Identifies whether the ReceiverIdle feature exists on the USART module.
7826  Description:
7827  This function identifies whether the ReceiverIdle feature is
7828  available on the USART module. When this function returns true, this
7829  function is supported on the device:
7830  - PLIB_USART_ReceiverIsIdle
7831  This operation is atomic.
7832  Preconditions:
7833  None.
7834  Parameters:
7835  index - Identifier for the device instance
7836  Returns:
7837  - true - The ReceiverIdle feature is supported on the device
7838  - false - The ReceiverIdle feature is not supported on the device
7839  Remarks:
7840  None.
7841 */
7842 
7843 bool
7845  USART_MODULE_ID index ) ;
7846 //******************************************************************************
7847 /* Function:
7848  PLIB_USART_ExistsReceiverFramingErrorStatus( USART_MODULE_ID index )
7849  Summary:
7850  Identifies whether the ReceiverFramingError feature exists on the USART module.
7851  Description:
7852  This function identifies whether the ReceiverFramingError feature is
7853  available on the USART module. When this function returns true, this
7854  function is supported on the device:
7855  - PLIB_USART_ReceiverFramingErrorHasOccurred
7856  This operation is atomic.
7857  Preconditions:
7858  None.
7859  Parameters:
7860  index - Identifier for the device instance
7861  Returns:
7862  - true - The ReceiverFramingError feature is supported on the device
7863  - false - The ReceiverFramingError feature is not supported on the device
7864  Remarks:
7865  None.
7866 */
7867 
7868 bool
7870  USART_MODULE_ID index ) ;
7871 //******************************************************************************
7872 /* Function:
7873  PLIB_USART_ExistsReceiverInterruptMode( USART_MODULE_ID index )
7874  Summary:
7875  Identifies whether the ReceiverInterruptMode feature exists on the USART module.
7876  Description:
7877  This function identifies whether the ReceiverInterruptMode feature is
7878  available on the USART module. When this function returns true, this
7879  function is supported on the device:
7880  - PLIB_USART_ReceiverInterruptModeSelect
7881  This operation is atomic.
7882  Preconditions:
7883  None.
7884  Parameters:
7885  index - Identifier for the device instance
7886  Returns:
7887  - true - The ReceiverInterruptMode feature is supported on the device
7888  - false - The ReceiverInterruptMode feature is not supported on the device
7889  Remarks:
7890  None.
7891 */
7892 
7893 bool
7895  USART_MODULE_ID index ) ;
7896 //******************************************************************************
7897 /* Function:
7898  PLIB_USART_ExistsReceiverIdleStateLowEnable( USART_MODULE_ID index )
7899  Summary:
7900  Identifies whether the ReceiverPolarityInvert feature exists on the USART module.
7901  Description:
7902  This function identifies whether the ReceiverPolarityInvert feature is
7903  available on the USART module. When this function returns true, these
7904  functions are supported on the device:
7905  - PLIB_USART_ReceiverIdleStateLowEnable
7906  - PLIB_USART_ReceiverIdleStateLowDisable
7907  This operation is atomic.
7908  Preconditions:
7909  None.
7910  Parameters:
7911  index - Identifier for the device instance
7912  Returns:
7913  - true - The ReceiverPolarityInvert feature is supported on the device
7914  - false - The ReceiverPolarityInvert feature is not supported on the device
7915  Remarks:
7916  None.
7917 */
7918 
7919 bool
7921  USART_MODULE_ID index ) ;
7922 //******************************************************************************
7923 /* Function:
7924  PLIB_USART_ExistsReceiverParityErrorStatus( USART_MODULE_ID index )
7925  Summary:
7926  Identifies whether the ReceiverParityError feature exists on the USART module.
7927  Description:
7928  This function identifies whether the ReceiverParityError feature is
7929  available on the USART module. When this function returns true, this
7930  function is supported on the device:
7931  - PLIB_USART_ReceiverParityErrorHasOccurred
7932  This operation is atomic.
7933  Preconditions:
7934  None.
7935  Parameters:
7936  index - Identifier for the device instance
7937  Returns:
7938  - true - The ReceiverParityError feature is supported on the device
7939  - false - The ReceiverParityError feature is not supported on the device
7940  Remarks:
7941  None.
7942 */
7943 
7944 bool
7946  USART_MODULE_ID index ) ;
7947 //******************************************************************************
7948 /* Function:
7949  PLIB_USART_ExistsReceiverOverrunStatus( USART_MODULE_ID index )
7950  Summary:
7951  Identifies whether the ReceiverOverrunError feature exists on the USART module.
7952  Description:
7953  This function identifies whether the ReceiverOverrunError feature is
7954  available on the USART module. When this function returns true, these
7955  functions are supported on the device:
7956  - PLIB_USART_ReceiverOverrunErrorClear
7957  - PLIB_USART_ReceiverOverrunHasOccurred
7958  This operation is atomic.
7959  Preconditions:
7960  None.
7961  Parameters:
7962  index - Identifier for the device instance
7963  Returns:
7964  - true - The ReceiverOverrunError feature is supported on the device
7965  - false - The ReceiverOverrunError feature is not supported on the device
7966  Remarks:
7967  None.
7968 */
7969 
7970 bool
7972  USART_MODULE_ID index ) ;
7973 //******************************************************************************
7974 /* Function:
7975  PLIB_USART_ExistsTransmitter( USART_MODULE_ID index )
7976  Summary:
7977  Identifies whether the Transmitter feature exists on the USART module.
7978  Description:
7979  This function identifies whether the Transmitter feature is
7980  available on the USART module. When this function returns true, these
7981  functions are supported on the device:
7982  - PLIB_USART_TransmitterByteSend
7983  - PLIB_USART_TransmitterAddressGet
7984  This operation is atomic.
7985  Preconditions:
7986  None.
7987  Parameters:
7988  index - Identifier for the device instance
7989  Returns:
7990  - true - The Transmitter feature is supported on the device
7991  - false - The Transmitter feature is not supported on the device
7992  Remarks:
7993  None.
7994 */
7995 
7996 bool
7998  USART_MODULE_ID index ) ;
7999 //******************************************************************************
8000 /* Function:
8001  PLIB_USART_ExistsTransmitter9BitsSend( USART_MODULE_ID index )
8002  Summary:
8003  Identifies whether the Transmitter9Bits feature exists on the USART module.
8004  Description:
8005  This function identifies whether the Transmitter9Bits feature is
8006  available on the USART module. When this function returns true, this
8007  function is supported on the device:
8008  - PLIB_USART_Transmitter9BitsSend
8009  This operation is atomic.
8010  Preconditions:
8011  None.
8012  Parameters:
8013  index - Identifier for the device instance
8014  Returns:
8015  - true - The Transmitter9Bits feature is supported on the device
8016  - false - The Transmitter9Bits feature is not supported on the device
8017  Remarks:
8018  None.
8019 */
8020 
8021 bool
8023  USART_MODULE_ID index ) ;
8024 //******************************************************************************
8025 /* Function:
8026  PLIB_USART_ExistsTransmitterBreak( USART_MODULE_ID index )
8027  Summary:
8028  Identifies whether the TransmitterBreak feature exists on the USART module.
8029  Description:
8030  This function identifies whether the TransmitterBreak feature is
8031  available on the USART module. When this function returns true, these
8032  functions are supported on the device:
8033  - PLIB_USART_TransmitterBreakSend
8034  - PLIB_USART_TransmitterBreakSendIsComplete
8035  This operation is atomic.
8036  Preconditions:
8037  None.
8038  Parameters:
8039  index - Identifier for the device instance
8040  Returns:
8041  - true - The TransmitterBreak feature is supported on the device
8042  - false - The TransmitterBreak feature is not supported on the device
8043  Remarks:
8044  None.
8045 */
8046 
8047 bool
8049  USART_MODULE_ID index ) ;
8050 //******************************************************************************
8051 /* Function:
8052  PLIB_USART_ExistsTransmitterBufferFullStatus( USART_MODULE_ID index )
8053  Summary:
8054  Identifies whether the TransmitterBufferFull feature exists on the USART module.
8055  Description:
8056  This function identifies whether the TransmitterBufferFull feature is
8057  available on the USART module. When this function returns true, this
8058  function is supported on the device:
8059  - PLIB_USART_TransmitterBufferIsFull
8060  This operation is atomic.
8061  Preconditions:
8062  None.
8063  Parameters:
8064  index - Identifier for the device instance
8065  Returns:
8066  - true - The TransmitterBufferFull feature is supported on the device
8067  - false - The TransmitterBufferFull feature is not supported on the device
8068  Remarks:
8069  None.
8070 */
8071 
8072 bool
8074  USART_MODULE_ID index ) ;
8075 //******************************************************************************
8076 /* Function:
8077  PLIB_USART_ExistsTransmitterEmptyStatus( USART_MODULE_ID index )
8078  Summary:
8079  Identifies whether the TransmitterEmpty feature exists on the USART module.
8080  Description:
8081  This function identifies whether the TransmitterEmpty feature is
8082  available on the USART module. When this function returns true, this
8083  function is supported on the device:
8084  - PLIB_USART_TransmitterIsEmpty
8085  This operation is atomic.
8086  Preconditions:
8087  None.
8088  Parameters:
8089  index - Identifier for the device instance
8090  Returns:
8091  - true - The TransmitterEmpty feature is supported on the device
8092  - false - The TransmitterEmpty feature is not supported on the device
8093  Remarks:
8094  None.
8095 */
8096 
8097 bool
8099  USART_MODULE_ID index ) ;
8100 //******************************************************************************
8101 /* Function:
8102  PLIB_USART_ExistsTransmitterEnable( USART_MODULE_ID index )
8103  Summary:
8104  Identifies whether the TransmitterEnableControl feature exists on the USART
8105  module
8106  Description:
8107  This function identifies whether the TransmitterEnableControl feature is
8108  available on the USART module. When this function returns true, these
8109  functions are supported on the device:
8110  - PLIB_USART_TransmitterEnable
8111  - PLIB_USART_TransmitterDisable
8112  This operation is atomic.
8113  Preconditions:
8114  None.
8115  Parameters:
8116  index - Identifier for the device instance
8117  Returns:
8118  - true - The TransmitterEnableControl feature is supported on the device
8119  - false - The TransmitterEnableControl feature is not supported on the device
8120  Remarks:
8121  None.
8122 */
8123 
8124 bool
8126  USART_MODULE_ID index ) ;
8127 //******************************************************************************
8128 /* Function:
8129  PLIB_USART_ExistsTransmitterInterruptMode( USART_MODULE_ID index )
8130  Summary:
8131  Identifies whether the TransmitterInterruptMode feature exists on the USART module.
8132  Description:
8133  This function identifies whether the TransmitterInterruptMode feature is
8134  available on the USART module. When this function returns true, this function
8135  is supported on the device:
8136  - PLIB_USART_TransmitterInterruptModeSelect
8137  This operation is atomic.
8138  Preconditions:
8139  None.
8140  Parameters:
8141  index - Identifier for the device instance
8142  Returns:
8143  - true - The TransmitterInterruptMode feature is supported on the device
8144  - false - The TransmitterInterruptMode feature is not supported on the device
8145  Remarks:
8146  None.
8147 */
8148 
8149 bool
8151  USART_MODULE_ID index ) ;
8152 //******************************************************************************
8153 /* Function:
8154  PLIB_USART_ExistsTransmitterIdleIsLow( USART_MODULE_ID index )
8155  Summary:
8156  Identifies whether the TransmitterIdleIsLow feature exists on the USART module.
8157  Description:
8158  This function identifies whether the TransmitterIdleIsLow feature is available
8159  on the USART module. When this function returns true, these functions are
8160  supported on the device:
8161  - PLIB_USART_TransmitterIdleIsLowDisable
8162  - PLIB_USART_TransmitterIdleIsLowEnable
8163  This operation is atomic.
8164  Preconditions:
8165  None.
8166  Parameters:
8167  index - Identifier for the device instance
8168  Returns:
8169  - true - The TransmitterIdleIsLow feature is supported on the device
8170  - false - The TransmitterIdleIsLow feature is not supported on the device
8171  Remarks:
8172  None.
8173 */
8174 
8175 bool
8177  USART_MODULE_ID index ) ;
8178 //DOM-IGNORE-BEGIN
8179 //DOM-IGNORE-END
8180  // #ifndef _PLIB_USART_H
8181 /******************************************************************************
8182  End of File
8183 */
8184 
8185 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h*/
8186 /* CLOSE_FILE Include File */
8187 
8188 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\system.h */
8189 /*******************************************************************************
8190  System Services Library Interface Header
8191  Company:
8192  Microchip Technology Inc.
8193  File Name:
8194  system.h
8195  Summary:
8196  Top level common system services library interface header.
8197  Description:
8198  This file is the top level common system services library interface header.
8199  It defines (or includes files that define) the common system service
8200  types, prototypes, and other definitions that are commonly used by MPLAB
8201  Harmony libraries and system services.
8202 
8203  System services provide common functionality that would otherwise need to
8204  be duplicated by multiple other modules or that would force them to
8205  interact in complex and hard to manage ways. System services eliminate
8206  conflicts by controlling access shared resources.
8207  Remarks:
8208  The parent directory to the "system" directory should be added to the
8209  compiler's search path for header files such that the following include
8210  statment will successfully include this file.
8211 
8212 #include "system/system.h"
8213  *******************************************************************************/
8214 //DOM-IGNORE-BEGIN
8215 /*******************************************************************************
8216 Copyright (c) 2011-2015 released Microchip Technology Inc. All rights reserved.
8217 Microchip licenses to you the right to use, modify, copy and distribute
8218 Software only when embedded on a Microchip microcontroller or digital signal
8219 controller that is integrated into your product or third party product
8220 (pursuant to the sublicense terms in the accompanying license agreement).
8221 You should refer to the license agreement accompanying this Software for
8222 additional information regarding your rights and obligations.
8223 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
8224 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8225 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8226 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8227 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8228 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8229 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8230 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8231 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8232 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8233  *******************************************************************************/
8234 //DOM-IGNORE-END
8235 #ifndef _SYSTEM_H
8236 #define _SYSTEM_H
8237 // *****************************************************************************
8238 // *****************************************************************************
8239 // Section: Included Files
8240 // *****************************************************************************
8241 // *****************************************************************************
8242 #include "system/common/sys_common.h"
8243 #include "system/common/sys_module.h"
8244 // DOM-IGNORE-BEGIN
8245 // DOM-IGNORE-END
8246 //DOM-IGNORE-BEGIN
8247 //DOM-IGNORE-END
8248  // _SYSTEM_H
8249 /*******************************************************************************
8250  End of File
8251 */
8252 #endif /*00 C:\microchip\harmony\v2_06\framework\system\system.h*/
8253 /* CLOSE_FILE Include File */
8254 
8255 #include "system/int/sys_int.h"
8256 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h */
8257 /*******************************************************************************
8258  DMA System Service Library Interface Definition
8259  Company:
8260  Microchip Technology Inc.
8261  File Name:
8262  sys_dma.h
8263  Summary:
8264  DMA System Service.
8265  Description:
8266  This file contains the interface definition for the DMA System
8267  Service. It provides a way to interact with the DMA subsystem to
8268  manage the data transfer between different peripherals and/or memory
8269  without intervention from the CPU.
8270 *******************************************************************************/
8271 //DOM-IGNORE-BEGIN
8272 /*******************************************************************************
8273 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
8274 Microchip licenses to you the right to use, modify, copy and distribute
8275 Software only when embedded on a Microchip microcontroller or digital signal
8276 controller that is integrated into your product or third party product
8277 (pursuant to the sublicense terms in the accompanying license agreement).
8278 You should refer to the license agreement accompanying this Software for
8279 additional information regarding your rights and obligations.
8280 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8281 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8282 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8283 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8284 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8285 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8286 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8287 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8288 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8289 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8290 *******************************************************************************/
8291 //DOM-IGNORE-END
8292 #ifndef _SYS_DMA_H
8293 #define _SYS_DMA_H
8294 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h */
8295 /*******************************************************************************
8296  DMA System Service Library Interface Definition
8297  Company:
8298  Microchip Technology Inc.
8299  File Name:
8300  sys_dma_definitions.h
8301  Summary:
8302  DMA System Service data type definitions header.
8303  Description:
8304  This file contains data type definitions header.
8305 *******************************************************************************/
8306 //DOM-IGNORE-BEGIN
8307 /*******************************************************************************
8308 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
8309 Microchip licenses to you the right to use, modify, copy and distribute
8310 Software only when embedded on a Microchip microcontroller or digital signal
8311 controller that is integrated into your product or third party product
8312 (pursuant to the sublicense terms in the accompanying license agreement).
8313 You should refer to the license agreement accompanying this Software for
8314 additional information regarding your rights and obligations.
8315 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8316 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8317 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8318 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8319 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8320 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8321 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8322 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8323 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8324 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8325 *******************************************************************************/
8326 //DOM-IGNORE-END
8327 #ifndef _SYS_DMA_DEFINITIONS_H
8328 #define _SYS_DMA_DEFINITIONS_H
8329 // *****************************************************************************
8330 // *****************************************************************************
8331 // Section: File includes
8332 // *****************************************************************************
8333 // *****************************************************************************
8334 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
8335 #include "system/common/sys_common.h"
8336 #include "system/common/sys_module.h"
8337 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h */
8338 /*******************************************************************************
8339  DMA Peripheral Library Interface Header
8340  Company:
8341  Microchip Technology Inc.
8342  File Name:
8343  plib_dma.h
8344  Summary:
8345  Defines the DMA Peripheral Library interface functions.
8346  Description:
8347  This header file contains the function prototypes and definitions of
8348  the data types and constants that make up the interface to the Direct Memory
8349  Access (DMA) Peripheral Library for Microchip microcontrollers. The
8350  definitions in this file are for the DMA module.
8351 *******************************************************************************/
8352 // DOM-IGNORE-BEGIN
8353 /*******************************************************************************
8354 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
8355 Microchip licenses to you the right to use, modify, copy and distribute
8356 Software only when embedded on a Microchip microcontroller or digital signal
8357 controller that is integrated into your product or third party product
8358 (pursuant to the sublicense terms in the accompanying license agreement).
8359 You should refer to the license agreement accompanying this Software for
8360 additional information regarding your rights and obligations.
8361 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8362 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8363 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8364 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8365 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8366 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8367 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8368 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8369 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8370 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8371 *******************************************************************************/
8372 // DOM-IGNORE-END
8373 #ifndef _PLIB_DMA_H
8374 #define _PLIB_DMA_H
8375 // DOM-IGNORE-BEGIN
8376 // DOM-IGNORE-END
8377 // *****************************************************************************
8378 // *****************************************************************************
8379 // Section: Includes
8380 // *****************************************************************************
8381 // *****************************************************************************
8382 /* See Bottom of file for implementation header include files.
8383 */
8384 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h */
8385 //DOM-IGNORE-BEGIN
8386 /*******************************************************************************
8387 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
8388 Microchip licenses to you the right to use, modify, copy and distribute
8389 Software only when embedded on a Microchip microcontroller or digital signal
8390 controller that is integrated into your product or third party product
8391 (pursuant to the sublicense terms in the accompanying license agreement).
8392 You should refer to the license agreement accompanying this Software for
8393 additional information regarding your rights and obligations.
8394 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
8395 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8396 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8397 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8398 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8399 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8400 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8401 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8402 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8403 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8404  *******************************************************************************/
8405 //DOM-IGNORE-END
8406 #ifndef _PLIB_DMA_PROCESSOR_H
8407 #define _PLIB_DMA_PROCESSOR_H
8408 #error "Can't find header"
8409 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h*/
8410 /* CLOSE_FILE Include File */
8411 
8412 // *****************************************************************************
8413 // *****************************************************************************
8414 // Section: Peripheral Library Interface Functions
8415 // *****************************************************************************
8416 // *****************************************************************************
8417 // *****************************************************************************
8418 // *****************************************************************************
8419 // Section: DMA Channel Status Functions
8420 // *****************************************************************************
8421 // *****************************************************************************
8422 //******************************************************************************
8423 /* Function:
8424  bool PLIB_DMA_ChannelXBufferedDataIsWritten ( DMA_MODULE_ID index,
8425  DMA_CHANNEL channel )
8426  Summary:
8427  Returns the buffered data write status for the specified channel.
8428  Description:
8429  This function returns the buffered data write status for the specified channel.
8430  Precondition:
8431  None.
8432  Parameters:
8433  channel - One of the existing DMA channels listed by DMA_CHANNEL
8434  Returns:
8435  - true - The content of the DMA buffer has not been written to the location
8436  specified in the destination/source address or in Null Write mode
8437  - false - The content of the DMA buffer has been written to the location
8438  specified in the destination/source address or in Null Write mode
8439  Example:
8440  <code>
8441  bool chBuffWriteStatus;
8442  chBuffWriteStatus = PLIB_DMA_ChannelXBufferedDataIsWritten( DMA_ID_0,
8443  DMA_CHANNEL_3 );
8444  </code>
8445  Remarks:
8446  This feature is not available on all devices. Please refer to the specific device
8447  data sheet to determine availability.
8448 */
8449 
8450 bool
8452  DMA_MODULE_ID index ,
8453  DMA_CHANNEL channel ) ;
8454 /*******************************************************************************
8455  Function:
8456  bool PLIB_DMA_ChannelXCollisionStatus ( DMA_MODULE_ID index,
8457  DMA_CHANNEL channel,
8458  DMA_CHANNEL_COLLISION collisonType )
8459  Summary:
8460  Returns the status of the specified collision type for the specified channel.
8461  Description:
8462  This function returns the status of the specified collision type for the
8463  specified channel.
8464  Precondition:
8465  None.
8466  Parameters:
8467  channel - One of the existing DMA channels listed by DMA_CHANNEL
8468  collisonType - Collision type listed by DMA_CHANNEL_COLLISION
8469  Returns:
8470  - true - A collision specified by collisonType was detected
8471  - false - No collision of type collisonType was detected
8472  Example:
8473  <code>
8474  bool memWriteCollisionStatus;
8475  memWriteCollisionStatus = PLIB_DMA_ChannelXMemoryWriteCollisionStatus(
8476  DMA_ID_0,
8477  DMA_CHANNEL_3,
8478  DMA_CHANNEL_COLLISION_MEMORY );
8479  </code>
8480  Remarks:
8481  This feature is not available on all devices. Please refer to the specific
8482  device data sheet to determine availability.
8483 */
8484 
8485 bool
8487  DMA_MODULE_ID index ,
8488  DMA_CHANNEL channel ,
8489  DMA_CHANNEL_COLLISION collisonType ) ;
8490 //******************************************************************************
8491 /* Function:
8492  DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet( DMA_MODULE_ID index,
8493  DMA_CHANNEL channel )
8494  Summary:
8495  Returns the Ping-Pong mode status for the specified channel.
8496  Description:
8497  This function returns the Ping-Pong mode status for the specified channel.
8498  Precondition:
8499  None.
8500  Parameters:
8501  channel - One of the existing DMA channels listed by DMA_CHANNEL
8502  Returns:
8503  mode - One of the possible Ping-Pong modes
8504  Example:
8505  <code>
8506  DMA_PING_PONG_MODE chPingPongStatus;
8507  chPingPongStatus = PLIB_DMA_ChannelXPingPongModeGet(DMA_ID_0,
8508  DMA_CHANNEL_3 );
8509  if (DMA_PING_PONG_SECONDARY == chPingPongStatus)
8510  {
8511  \\Application
8512  }
8513  </code>
8514  Remarks:
8515  This feature is not available on all devices. Please refer to the specific
8516  device data sheet to determine availability.
8517 */
8518 
8519 DMA_PING_PONG_MODE
8521  DMA_MODULE_ID index ,
8522  DMA_CHANNEL channel ) ;
8523 //******************************************************************************
8524 /* Function:
8525  bool PLIB_DMA_ChannelXEventIsDetected ( DMA_MODULE_ID index,
8526  DMA_CHANNEL channel )
8527  Summary:
8528  Returns the event status on the specified channel.
8529  Description:
8530  This function returns the event status on the specified channel.
8531  Precondition:
8532  None.
8533  Parameters:
8534  channel - One of the possible DMA channels listed by DMA_CHANNEL
8535  Returns:
8536  - true - An event was detected
8537  - false - No events were detected
8538  Example:
8539  <code>
8540  bool channeleventStatus;
8541  channeleventStatus = PLIB_DMA_ChannelXEventIsDetected( DMA_ID_0,
8542  DMA_CHANNEL_2 );
8543  </code>
8544  Remarks:
8545  This function implements an operation of the ChannelXEvent feature.
8546  This feature may not be available on all devices. Please refer to the
8547  specific device data sheet to determine availability or include the
8548  PLIB_DMA_ExistsChannelXEvent function in your application to determine
8549  whether this feature is available.
8550 */
8551 
8552 bool
8554  DMA_MODULE_ID index ,
8555  DMA_CHANNEL channel ) ;
8556 // *****************************************************************************
8557 // *****************************************************************************
8558 // Section: DMA Channel Configuration Functions
8559 // *****************************************************************************
8560 // *****************************************************************************
8561 //******************************************************************************
8562 /* Function:
8563  void PLIB_DMA_ChannelXPrioritySelect ( DMA_MODULE_ID index,
8564  DMA_CHANNEL channel,
8565  DMA_CHANNEL_PRIORITY channelPriority )
8566  Summary:
8567  Sets the priority of the specified channel.
8568  Description:
8569  This function sets the priority of the specified channel.
8570  Precondition:
8571  None.
8572  Parameters:
8573  channel - One of the existing DMA channels listed by DMA_CHANNEL
8574  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8575  Returns:
8576  None.
8577  Example:
8578  <code>
8579  DMA_CHANNEL channel = DMA_CHANNEL_0;
8580  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_PRIORITY_3;
8581  PLIB_DMA_ChannelXPrioritySelect( DMA_ID_0, channel, channelPriority );
8582  </code>
8583  Remarks:
8584  This function implements an operation of the ChannelXPriority feature.
8585  This feature may not be available on all devices. Please refer to the
8586  specific device data sheet to determine availability or use the
8587  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8588  whether this feature is available.
8589 */
8590 
8591 void
8593  DMA_MODULE_ID index ,
8594  DMA_CHANNEL channel ,
8595  DMA_CHANNEL_PRIORITY channelPriority ) ;
8596 //******************************************************************************
8597 /* Function:
8598  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet ( DMA_MODULE_ID index,
8599  DMA_CHANNEL channel )
8600  Summary:
8601  Gets the priority of the specified channel.
8602  Description:
8603  This function gets the priority of the specified channel.
8604  Precondition:
8605  None.
8606  Parameters:
8607  channel - One of the existing DMA channels listed by DMA_CHANNEL
8608  Returns:
8609  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8610  Example:
8611  <code>
8612  DMA_CHANNEL channel = DMA_CHANNEL_0;
8613  DMA_CHANNEL_PRIORITY channelPriority;
8614  channelPriority = PLIB_DMA_ChannelXPriorityGet( DMA_ID_0, channel );
8615  </code>
8616  Remarks:
8617  This function implements an operation of the ChannelXPriority feature.
8618  This feature may not be available on all devices. Please refer to the
8619  specific device data sheet to determine availability or use the
8620  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8621  whether this feature is available.
8622 */
8623 
8624 DMA_CHANNEL_PRIORITY
8626  DMA_MODULE_ID index ,
8627  DMA_CHANNEL channel ) ;
8628 //******************************************************************************
8629 /* Function:
8630  void PLIB_DMA_ChannelPrioritySelect ( DMA_MODULE_ID index,
8631  DMA_CHANNEL_PRIORITY channelPriority )
8632  Summary:
8633  Sets the priority scheme of the DMA channels.
8634  Description:
8635  This function sets the priority scheme of the DMA channels at the global level.
8636  This function is used in devices that do not have the per channel priority feature.
8637  Precondition:
8638  None.
8639  Parameters:
8640  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8641  Returns:
8642  None.
8643  Example:
8644  <code>
8645  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_ROUND_ROBIN;
8646  PLIB_DMA_ChannelPrioritySelect( DMA_ID_0, channelPriority );
8647  </code>
8648  Remarks:
8649  This feature is not available on all devices. Please refer to the specific
8650  device data sheet to determine availability.
8651 */
8652 
8653 void
8655  DMA_MODULE_ID index ,
8656  DMA_CHANNEL_PRIORITY channelPriority ) ;
8657 //******************************************************************************
8658 /* Function:
8659  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet ( DMA_MODULE_ID index )
8660  Summary:
8661  Gets the priority scheme of the DMA channels.
8662  Description:
8663  This function gets the priority scheme of the DMA channels at the global level.
8664  This function is used in devices that do not have the per channel priority feature.
8665  Precondition:
8666  None.
8667  Parameters:
8668  None.
8669  Returns:
8670  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8671  Example:
8672  <code>
8673  DMA_CHANNEL_PRIORITY channelPriority;
8674  channelPriority = PLIB_DMA_ChannelPriorityGet( DMA_ID_0 );
8675  </code>
8676  Remarks:
8677  This feature is not available on all devices. Please refer to the specific
8678  device data sheet to determine availability.
8679 */
8680 
8681 DMA_CHANNEL_PRIORITY
8683  DMA_MODULE_ID index ) ;
8684 //******************************************************************************
8685 /* Function:
8686  void PLIB_DMA_ChannelXAutoEnable ( DMA_MODULE_ID index,
8687  DMA_CHANNEL channel )
8688  Summary:
8689  Channel is continuously enabled.
8690  Description:
8691  This function enables the channel continuously. The channel is not automatically
8692  disabled after a block transfer is complete.
8693  Precondition:
8694  None.
8695  Parameters:
8696  channel - One of the possible DMA channels listed by DMA_CHANNEL
8697  Returns:
8698  None.
8699  Example:
8700  <code>
8701  PLIB_DMA_ChannelXAutoEnable( DMA_ID_0, DMA_CHANNEL_2 );
8702  </code>
8703  Remarks:
8704  This function implements an operation of the ChannelXAuto feature.
8705  This feature may not be available on all devices. Please refer to the
8706  specific device data sheet to determine availability or use the
8707  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8708  whether this feature is available.
8709 */
8710 
8711 void
8713  DMA_MODULE_ID index ,
8714  DMA_CHANNEL channel ) ;
8715 //******************************************************************************
8716 /* Function:
8717  bool PLIB_DMA_ChannelXAutoIsEnabled ( DMA_MODULE_ID index,
8718  DMA_CHANNEL channel )
8719  Summary:
8720  Returns the channel automatic enable status.
8721  Description:
8722  This function returns the channel automatic enable status.
8723  Precondition:
8724  None.
8725  Parameters:
8726  channel - One of the possible DMA channels listed by DMA_CHANNEL
8727  Returns:
8728  - true - Channel automatic enable is on
8729  - false - Channel automatic enable is off
8730  Example:
8731  <code>
8732  bool ChAutoEnableStatus;
8733  ChAutoEnableStatus = PLIB_DMA_ChannelXAutoIsEnabled(DMA_ID_0, DMA_CHANNEL_2 );
8734  </code>
8735  Remarks:
8736  This function implements an operation of the ChannelXAuto feature.
8737  This feature may not be available on all devices. Please refer to the
8738  specific device data sheet to determine availability or use the
8739  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8740  whether this feature is available.
8741 */
8742 
8743 bool
8745  DMA_MODULE_ID index ,
8746  DMA_CHANNEL channel ) ;
8747 //******************************************************************************
8748 /* Function:
8749  void PLIB_DMA_ChannelXAutoDisable ( DMA_MODULE_ID index,
8750  DMA_CHANNEL channel )
8751  Summary:
8752  Channel is disabled after a block transfer is complete.
8753  Description:
8754  This function disables a channel after a block transfer is complete.
8755  Precondition:
8756  None.
8757  Parameters:
8758  channel - One of the possible DMA channels listed by DMA_CHANNEL
8759  Returns:
8760  None.
8761  Example:
8762  <code>
8763  PLIB_DMA_ChannelXAutoDisable( DMA_ID_0, DMA_CHANNEL_2 );
8764  </code>
8765  Remarks:
8766  This function implements an operation of the ChannelXAuto feature.
8767  This feature may not be available on all devices. Please refer to the
8768  specific device data sheet to determine availability or use the
8769  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8770  whether this feature is available.
8771 */
8772 
8773 void
8775  DMA_MODULE_ID index ,
8776  DMA_CHANNEL channel ) ;
8777 //******************************************************************************
8778 /* Function:
8779  void PLIB_DMA_ChannelXChainEnable ( DMA_MODULE_ID index,
8780  DMA_CHANNEL channel )
8781  Summary:
8782  Channel chain feature is enabled.
8783  Description:
8784  This function enables the channel chain feature.
8785  Precondition:
8786  None.
8787  Parameters:
8788  channel - One of the possible DMA channels listed by DMA_CHANNEL
8789  Returns:
8790  None.
8791  Example:
8792  <code>
8793  PLIB_DMA_ChannelXChainEnable( DMA_ID_0, DMA_CHANNEL_2 );
8794  </code>
8795  Remarks:
8796  This function implements an operation of the ChannelXChainEnbl feature.
8797  This feature may not be available on all devices. Please refer to the
8798  specific device data sheet to determine availability or use the
8799  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8800  whether this feature is available.
8801 */
8802 
8803 void
8805  DMA_MODULE_ID index ,
8806  DMA_CHANNEL channel ) ;
8807 //******************************************************************************
8808 /* Function:
8809  bool PLIB_DMA_ChannelXChainIsEnabled ( DMA_MODULE_ID index,
8810  DMA_CHANNEL channel )
8811  Summary:
8812  Returns the chain status of the specified channel.
8813  Description:
8814  This function returns the chain status of the specified channel.
8815  Precondition:
8816  None.
8817  Parameters:
8818  channel - One of the possible DMA channels listed by DMA_CHANNEL
8819  Returns:
8820  - true - The channel chain is on for this channel
8821  - false - The channel chain is off for this channel
8822  Example:
8823  <code>
8824  bool ChchainStatus;
8825  ChchainStatus = PLIB_DMA_ChannelXChainIsEnabled( DMA_ID_0, DMA_CHANNEL_2 );
8826  </code>
8827  Remarks:
8828  This function implements an operation of the ChannelXChainEnbl feature.
8829  This feature may not be available on all devices. Please refer to the
8830  specific device data sheet to determine availability or use the
8831  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8832  whether this feature is available.
8833 */
8834 
8835 bool
8837  DMA_MODULE_ID index ,
8838  DMA_CHANNEL channel ) ;
8839 //******************************************************************************
8840 /* Function:
8841  void PLIB_DMA_ChannelXChainDisable( DMA_MODULE_ID index,
8842  DMA_CHANNEL channel )
8843  Summary:
8844  Disables the channel chaining for the specified DMA channel.
8845  Description:
8846  This function disables the channel chaining for the specified DMA channel.
8847  Precondition:
8848  None.
8849  Parameters:
8850  channel - One of the possible DMA channels listed by DMA_CHANNEL
8851  Returns:
8852  None.
8853  Example:
8854  <code>
8855  PLIB_DMA_ChannelXChainDisable( DMA_ID_0, DMA_CHANNEL_2 );
8856  </code>
8857  Remarks:
8858  This function implements an operation of the ChannelXChainEnbl feature.
8859  This feature may not be available on all devices. Please refer to the
8860  specific device data sheet to determine availability or use the
8861  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8862  whether this feature is available.
8863 */
8864 
8865 void
8867  DMA_MODULE_ID index ,
8868  DMA_CHANNEL channel ) ;
8869 //******************************************************************************
8870 /* Function:
8871  void PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_MODULE_ID index,
8872  DMA_CHANNEL channel )
8873  Summary:
8874  Channel start/abort events will be registered even if the channel is
8875  disabled.
8876  Description:
8877  This function will allow the channel register start/abort events even if the
8878  channel is disabled.
8879  Precondition:
8880  None.
8881  Parameters:
8882  channel - One of the possible DMA channels listed by DMA_CHANNEL
8883  Returns:
8884  None.
8885  Example:
8886  <code>
8887  PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8888  </code>
8889  Remarks:
8890  This function implements an operation of the ChannelXDisabled feature.
8891  This feature may not be available on all devices. Please refer to the
8892  specific device data sheet to determine availability or use the
8893  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8894  determine whether this feature is available.
8895 */
8896 
8897 void
8899  DMA_MODULE_ID index ,
8900  DMA_CHANNEL channel ) ;
8901 //******************************************************************************
8902 /* Function:
8903  void PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_MODULE_ID index,
8904  DMA_CHANNEL channel )
8905  Summary:
8906  Channel start/abort events will be ignored even if the channel is
8907  disabled.
8908  Description:
8909  This function will allow the channel start/abort events to be ignored even if
8910  the channel is disabled.
8911  Precondition:
8912  None.
8913  Parameters:
8914  channel - One of the possible DMA channels listed by DMA_CHANNEL
8915  Returns:
8916  None.
8917  Example:
8918  <code>
8919  PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8920  </code>
8921  Remarks:
8922  This function implements an operation of the ChannelXDisabled feature.
8923  This feature may not be available on all devices. Please refer to the
8924  specific device data sheet to determine availability or use the
8925  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8926  determine whether this feature is available.
8927 */
8928 
8929 void
8931  DMA_MODULE_ID index ,
8932  DMA_CHANNEL channel ) ;
8933 //******************************************************************************
8934 /* Function:
8935  void PLIB_DMA_ChannelXEnable ( DMA_MODULE_ID index,
8936  DMA_CHANNEL channel )
8937  Summary:
8938  Enable the specified channel.
8939  Description:
8940  This function will enable the specified channel.
8941  Precondition:
8942  None.
8943  Parameters:
8944  channel - One of the possible DMA channels listed by DMA_CHANNEL
8945  Returns:
8946  None.
8947  Example:
8948  <code>
8949  PLIB_DMA_ChannelXEnable ( DMA_ID_0, DMA_CHANNEL_2 );
8950  </code>
8951  Remarks:
8952  This function implements an operation of the ChannelX feature.
8953  This feature may not be available on all devices. Please refer to the
8954  specific device data sheet to determine availability or use the
8955  PLIB_DMA_ExistsChannelX function in your application to automatically
8956  determine whether this feature is available.
8957 */
8958 
8959 void
8961  DMA_MODULE_ID index ,
8962  DMA_CHANNEL channel ) ;
8963 //******************************************************************************
8964 /* Function:
8965  bool PLIB_DMA_ChannelXIsEnabled ( DMA_MODULE_ID index,
8966  DMA_CHANNEL channel )
8967  Summary:
8968  Return the enable status of the specified channel.
8969  Description:
8970  This function will return the enable status of the specified channel.
8971  Precondition:
8972  None.
8973  Parameters:
8974  channel - One of the possible DMA channels listed by DMA_CHANNEL
8975  Returns:
8976  - true - The specified DMA channel is enabled
8977  - false - The specified DMA channel is disabled
8978  Example:
8979  <code>
8980  bool chEnableStatus;
8981  chEnableStatus = PLIB_DMA_ChannelXIsEnabled ( DMA_ID_0, DMA_CHANNEL_2 );
8982  </code>
8983  Remarks:
8984  This function implements an operation of the ChannelX feature.
8985  This feature may not be available on all devices. Please refer to the
8986  specific device data sheet to determine availability or use the
8987  PLIB_DMA_ExistsChannelX function in your application to automatically
8988  determine whether this feature is available.
8989 */
8990 
8991 bool
8993  DMA_MODULE_ID index ,
8994  DMA_CHANNEL channel ) ;
8995 //******************************************************************************
8996 /* Function:
8997  void PLIB_DMA_ChannelXDisable ( DMA_MODULE_ID index,
8998  DMA_CHANNEL channel )
8999  Summary:
9000  Disable the specified channel.
9001  Description:
9002  This function will disable the specified channel.
9003  Precondition:
9004  None.
9005  Parameters:
9006  channel - One of the possible DMA channels listed by DMA_CHANNEL
9007  Returns:
9008  None.
9009  Example:
9010  <code>
9011  PLIB_DMA_ChannelXDisable ( DMA_ID_0, DMA_CHANNEL_2 );
9012  </code>
9013  Remarks:
9014  This function implements an operation of the ChannelX feature.
9015  This feature may not be available on all devices. Please refer to the
9016  specific device data sheet to determine availability or use the
9017  PLIB_DMA_ExistsChannelX function in your application to automatically
9018  determine whether this feature is available.
9019 */
9020 
9021 void
9023  DMA_MODULE_ID index ,
9024  DMA_CHANNEL channel ) ;
9025 //******************************************************************************
9026 /* Function:
9027  void PLIB_DMA_ChannelXChainToLower( DMA_MODULE_ID index,
9028  DMA_CHANNEL channel )
9029  Summary:
9030  Chains the specified channel to a channel lower in natural priority.
9031  Description:
9032  This function will chain the specified channel to a channel lower in
9033  natural priority. CH3 will be enabled by a CH4 transfer complete.
9034  Precondition:
9035  None.
9036  Parameters:
9037  channel - One of the possible DMA channels listed by DMA_CHANNEL
9038  Returns:
9039  None.
9040  Example:
9041  <code>
9042  PLIB_DMA_ChannelXChainToLower ( DMA_ID_0, DMA_CHANNEL_4 );
9043  </code>
9044  Remarks:
9045  This function implements an operation of the ChannelXChain feature.
9046  This feature may not be available on all devices. Please refer to the
9047  specific device data sheet to determine availability or use the
9048  PLIB_DMA_ExistsChannelXChain function in your application to automatically
9049  determine whether this feature is available.
9050 */
9051 
9052 void
9054  DMA_MODULE_ID index ,
9055  DMA_CHANNEL channel ) ;
9056 //******************************************************************************
9057 /* Function:
9058  void PLIB_DMA_ChannelXChainToHigher ( DMA_MODULE_ID index,
9059  DMA_CHANNEL channel )
9060  Summary:
9061  Chains the specified channel to a channel higher in natural priority.
9062  Description:
9063  This function will chain the specified channel to a channel higher in
9064  natural priority. CH5 will be enabled by a CH4 transfer complete.
9065  Precondition:
9066  None.
9067  Parameters:
9068  channel - One of the possible DMA channels listed by DMA_CHANNEL
9069  Returns:
9070  None.
9071  Example:
9072  <code>
9073  PLIB_DMA_ChannelXChainToHigher ( DMA_ID_0, DMA_CHANNEL_4 );
9074  </code>
9075  Remarks:
9076  This function implements an operation of the ChannelXChain feature.
9077  This feature may not be available on all devices. Please refer to the
9078  specific device data sheet to determine availability or use the
9079  PLIB_DMA_ExistsChannelXChain function in your application to automatically
9080  determine whether this feature is available.
9081 */
9082 
9083 void
9085  DMA_MODULE_ID index ,
9086  DMA_CHANNEL channel ) ;
9087 //******************************************************************************
9088 /* Function:
9089  void PLIB_DMA_ChannelXBusyActiveSet ( DMA_MODULE_ID index,
9090  DMA_CHANNEL channel )
9091  Summary:
9092  Sets the Busy bit to active.
9093  Description:
9094  This function sets the Busy bit to active, indicating the channel is active
9095  or has been enabled.
9096  Precondition:
9097  None.
9098  Parameters:
9099  channel - One of the possible DMA channels listed by DMA_CHANNEL
9100  Returns:
9101  None.
9102  Example:
9103  <code>
9104  PLIB_DMA_ChannelXBusyActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
9105  </code>
9106  Remarks:
9107  This function implements an operation of the ChannelXBusy feature.
9108  This feature may not be available on all devices. Please refer to the
9109  specific device data sheet to determine availability or use the
9110  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
9111  determine whether this feature is available.
9112 */
9113 
9114 void
9116  DMA_MODULE_ID index ,
9117  DMA_CHANNEL channel ) ;
9118 //******************************************************************************
9119 /* Function:
9120  void PLIB_DMA_ChannelXBusyInActiveSet ( DMA_MODULE_ID index,
9121  DMA_CHANNEL channel )
9122  Summary:
9123  Sets the Busy bit to inactive.
9124  Description:
9125  This function sets the Busy bit to inactive, indicating the channel is inactive
9126  or has been disabled.
9127  Precondition:
9128  None.
9129  Parameters:
9130  channel - One of the possible DMA channels listed by DMA_CHANNEL
9131  Returns:
9132  None.
9133  Example:
9134  <code>
9135  PLIB_DMA_ChannelXBusyInActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
9136  </code>
9137  Remarks:
9138  This function implements an operation of the ChannelXBusy feature.
9139  This feature may not be available on all devices. Please refer to the
9140  specific device data sheet to determine availability or use the
9141  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
9142  determine whether this feature is available.
9143 */
9144 
9145 void
9147  DMA_MODULE_ID index ,
9148  DMA_CHANNEL channel ) ;
9149 //******************************************************************************
9150 /* Function:
9151  bool PLIB_DMA_ChannelXBusyIsBusy ( DMA_MODULE_ID index,
9152  DMA_CHANNEL channel )
9153  Summary:
9154  Returns the busy status of the specified channel.
9155  Description:
9156  This function returns the busy status of the specified channel.
9157  Precondition:
9158  None.
9159  Parameters:
9160  channel - One of the possible DMA channels listed by DMA_CHANNEL
9161  Returns:
9162  - true - The channel is active or has been enabled
9163  - false - The channel is inactive or has been disabled
9164  Example:
9165  <code>
9166  bool chBusyStatus;
9167  chBusyStatus = PLIB_DMA_ChannelXBusyIsBusy ( DMA_ID_0, DMA_CHANNEL_4 );
9168  </code>
9169  Remarks:
9170  This function implements an operation of the ChannelXBusy feature.
9171  This feature may not be available on all devices. Please refer to the
9172  specific device data sheet to determine availability or use the
9173  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
9174  determine whether this feature is available.
9175 */
9176 
9177 bool
9179  DMA_MODULE_ID index ,
9180  DMA_CHANNEL channel ) ;
9181 //******************************************************************************
9182 /* Function:
9183  void PLIB_DMA_ChannelXTransferDirectionSelect ( DMA_MODULE_ID index,
9184  DMA_CHANNEL channel,
9185  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection )
9186  Summary:
9187  Selects the data transfer direction of the specified channel.
9188  Description:
9189  This function selects the data transfer direction of the specified channel.
9190  Precondition:
9191  None.
9192  Parameters:
9193  channel - One of the possible DMA channels listed by DMA_CHANNEL
9194  chTransferDirection - The transfer direction indicated by DMA_CHANNEL_TRANSFER_DIRECTION
9195  Returns:
9196  None.
9197  Example:
9198  <code>
9199  PLIB_DMA_ChannelXTransferDirectionSelect (
9200  DMA_ID_0,
9201  DMA_CHANNEL_4,
9202  DMA_READ_FROM_MEMORY_WRITE_TO_PERIPHERAL );
9203  </code>
9204  Remarks:
9205  This feature is not available on all devices. Please refer to the specific
9206  device data sheet to determine availability.
9207 */
9208 
9209 void
9211  DMA_MODULE_ID index ,
9212  DMA_CHANNEL channel ,
9213  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection ) ;
9214 //******************************************************************************
9215 /* Function:
9216  DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet (
9217  DMA_MODULE_ID index,
9218  DMA_CHANNEL channel)
9219  Summary:
9220  Returns the data transfer direction of the specified channel.
9221  Description:
9222  This function returns the data transfer direction of the specified channel.
9223  Precondition:
9224  None.
9225  Parameters:
9226  channel - One of the possible DMA channels listed by DMA_CHANNEL
9227  Returns:
9228  - DMA_CHANNEL_TRANSFER_DIRECTION - The transfer direction indicated by the
9229  DMA_CHANNEL_TRANSFER_DIRECTION
9230  Example:
9231  <code>
9232  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection;
9233  chTransferDirection = PLIB_DMA_ChannelXTransferDirectionGet (
9234  DMA_ID_0,
9235  DMA_CHANNEL_4 );
9236  </code>
9237  Remarks:
9238  This feature is not available on all devices. Please refer to the specific
9239  device data sheet to determine availability.
9240 */
9241 
9242 DMA_CHANNEL_TRANSFER_DIRECTION
9244  DMA_MODULE_ID index ,
9245  DMA_CHANNEL channel ) ;
9246 //******************************************************************************
9247 /* Function:
9248  void PLIB_DMA_ChannelXStartAddressOffsetSet( DMA_MODULE_ID index,
9249  DMA_CHANNEL channel ,
9250  uint16_t address,
9251  DMA_ADDRESS_OFFSET_TYPE offset )
9252  Summary:
9253  Sets the primary/secondary start address (DPSRAM) offset to the value
9254  specified depending on the offset type specified for the specified channel.
9255  Description:
9256  This function sets the primary/secondary start address (DPSRAM) offset to the value
9257  specified depending on the offset type specified for the specified channel.
9258  Precondition:
9259  None.
9260  Parameters:
9261  channel - One of the possible DMA channels listed by DMA_CHANNEL
9262  address - The primary/secondary DPSRAM start address offset
9263  offset - The type of the address offset (primary/secondary)
9264  Returns:
9265  None.
9266  Example:
9267  <code>
9268  uint16_t address = 0x100;
9269  PLIB_DMA_ChannelXStartAddressOffsetSet ( DMA_ID_0,
9270  DMA_CHANNEL_4,
9271  address,
9272  DMA_ADDRESS_OFFSET_PRIMARY );
9273  </code>
9274  Remarks:
9275  This feature is not available on all devices. Please refer to the specific
9276  device data sheet to determine availability.
9277 */
9278 
9279 void
9281  DMA_MODULE_ID index ,
9282  DMA_CHANNEL channel ,
9283  uint16_t address ,
9284  DMA_ADDRESS_OFFSET_TYPE offset ) ;
9285 //******************************************************************************
9286 /* Function:
9287  uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet ( DMA_MODULE_ID index,
9288  DMA_CHANNEL channel,
9289  DMA_ADDRESS_OFFSET_TYPE offset)
9290  Summary:
9291  Gets the primary/secondary start address (DPSRAM) offset.
9292  Description:
9293  This function gets the primary/secondary start address (DPSRAM) offset.
9294  Precondition:
9295  None.
9296  Parameters:
9297  channel - One of the possible DMA channels listed by DMA_CHANNEL
9298  offset - The type of the address offset (primary/secondary)
9299  Returns:
9300  - uint16_t - The primary/secondary DPSRAM start address offset
9301  Example:
9302  <code>
9303  uint16_t addressOffsetA;
9304  addressOffsetA = PLIB_DMA_ChannelXStartAddressOffsetGet (
9305  DMA_ID_0,
9306  DMA_CHANNEL_4,
9307  address,
9308  DMA_ADDRESS_OFFSET_PRIMARY );
9309  </code>
9310  Remarks:
9311  This feature is not available on all devices. Please refer to the specific
9312  device data sheet to determine availability.
9313 */
9314 
9315 uint16_t
9317  DMA_MODULE_ID index ,
9318  DMA_CHANNEL channel ,
9319  DMA_ADDRESS_OFFSET_TYPE offset ) ;
9320 //******************************************************************************
9321 /* Function:
9322  void PLIB_DMA_ChannelXPeripheralAddressSet( DMA_MODULE_ID index,
9323  DMA_CHANNEL channel ,
9324  uint16_t peripheraladdress )
9325  Summary:
9326  Sets the peripheral address for the specified channel.
9327  Description:
9328  This function sets the peripheral address for the specified channel.
9329  Precondition:
9330  None.
9331  Parameters:
9332  channel - One of the possible DMA channels listed by DMA_CHANNEL
9333  peripheraladdress - The peripheral address for the specified channel
9334  Returns:
9335  None.
9336  Example:
9337  <code>
9338  uint16_t peripheraladdress = 0x100;
9339  PLIB_DMA_ChannelXPeripheralAddressSet ( DMA_ID_0,
9340  DMA_CHANNEL_4,
9341  peripheraladdress );
9342  </code>
9343  Remarks:
9344  This feature is not available on all devices. Please refer to the specific
9345  device data sheet to determine availability.
9346 */
9347 
9348 void
9350  DMA_MODULE_ID index ,
9351  DMA_CHANNEL channel ,
9352  uint16_t peripheraladdress ) ;
9353 //******************************************************************************
9354 /* Function:
9355  uint16_t PLIB_DMA_ChannelXPeripheralAddressGet( DMA_MODULE_ID index,
9356  DMA_CHANNEL channel )
9357  Summary:
9358  Gets the peripheral address configured for the specified channel.
9359  Description:
9360  This function gets the peripheral address configured for the specified channel.
9361  Precondition:
9362  None.
9363  Parameters:
9364  channel - One of the possible DMA channels listed by DMA_CHANNEL
9365  Returns:
9366  - uint16_t - The peripheral address configured for the specified channel
9367  Example:
9368  <code>
9369  uint16_t peripheraladdress;
9370  peripheraladdress = PLIB_DMA_ChannelXPeripheralAddressGet ( DMA_ID_0,
9371  DMA_CHANNEL_4 );
9372  </code>
9373  Remarks:
9374  This feature is not available on all devices. Please refer to the specific
9375  device data sheet to determine availability.
9376 */
9377 
9378 uint16_t
9380  DMA_MODULE_ID index ,
9381  DMA_CHANNEL channel ) ;
9382 //******************************************************************************
9383 /* Function:
9384  void PLIB_DMA_ChannelXTransferCountSet( DMA_MODULE_ID index,
9385  DMA_CHANNEL channel ,
9386  uint16_t transferCount )
9387  Summary:
9388  Sets the DMA data transfer count for the specified channel.
9389  Description:
9390  This function sets the DMA data transfer count for the specified channel.
9391  Precondition:
9392  None.
9393  Parameters:
9394  channel - One of the possible DMA channels listed by DMA_CHANNEL
9395  transferCount - The DMA transfer count for the channel
9396  Returns:
9397  None.
9398  Example:
9399  <code>
9400  uint16_t transferCount = 0x10;
9401  PLIB_DMA_ChannelXTransferCountSet ( DMA_ID_0,
9402  DMA_CHANNEL_4,
9403  transferCount );
9404  </code>
9405  Remarks:
9406  This feature is not available on all devices. Please refer to the specific
9407  device data sheet to determine availability.
9408 */
9409 
9410 void
9412  DMA_MODULE_ID index ,
9413  DMA_CHANNEL channel ,
9414  uint16_t transferCount ) ;
9415 //******************************************************************************
9416 /* Function:
9417  uint16_t PLIB_DMA_ChannelXTransferCountGet( DMA_MODULE_ID index,
9418  DMA_CHANNEL channel )
9419  Summary:
9420  Gets the DMA data transfer count that is programmed for the specified channel.
9421  Description:
9422  This function gets the DMA data transfer count that is programmed for the specified channel.
9423  Precondition:
9424  None.
9425  Parameters:
9426  channel - One of the possible DMA channels listed by DMA_CHANNEL
9427  Returns:
9428  - uint16_t - The DMA transfer count for the channel
9429  Example:
9430  <code>
9431  uint16_t transferCount;
9432  transferCount = PLIB_DMA_ChannelXTransferCountGet ( DMA_ID_0,
9433  DMA_CHANNEL_4 );
9434  </code>
9435  Remarks:
9436  This feature is not available on all devices. Please refer to the specific
9437  device data sheet to determine availability.
9438 */
9439 
9440 uint16_t
9442  DMA_MODULE_ID index ,
9443  DMA_CHANNEL channel ) ;
9444 //******************************************************************************
9445 /* Function:
9446  void PLIB_DMA_ChannelXSourceAddressModeSelect (
9447  DMA_MODULE_ID index,
9448  DMA_CHANNEL channel,
9449  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode )
9450  Summary:
9451  Sets the source address mode of the specified channel.
9452  Description:
9453  This function sets the source address mode of the specified channel.
9454  Precondition:
9455  None.
9456  Parameters:
9457  channel - One of the possible DMA channels listed by DMA_CHANNEL
9458  sourceAddressMode - One of the possible source addressing modes listed by
9459  DMA_SOURCE_ADDRESSING_MODE
9460  Returns:
9461  None.
9462  Example:
9463  <code>
9464  PLIB_DMA_ChannelXSourceAddressModeSelect (
9465  DMA_ID_0,
9466  DMA_CHANNEL_4,
9467  DMA_ADDRESSING_SOURCE_INCREMENT_BASED_ON_SIZE );
9468  </code>
9469  Remarks:
9470  This feature is not available on all devices. Please refer to the specific
9471  device data sheet to determine availability.
9472 */
9473 
9474 void
9476  DMA_MODULE_ID index ,
9477  DMA_CHANNEL channel ,
9478  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode ) ;
9479 //******************************************************************************
9480 /* Function:
9481  DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet (
9482  DMA_MODULE_ID index,
9483  DMA_CHANNEL channel )
9484  Summary:
9485  Gets the source address mode of the specified channel.
9486  Description:
9487  This function gets the source address mode of the specified channel.
9488  Precondition:
9489  None.
9490  Parameters:
9491  channel - One of the possible DMA channels listed by DMA_CHANNEL
9492  Returns:
9493  - DMA_SOURCE_ADDRESSING_MODE - One of the possible source addressing modes
9494  listed by DMA_SOURCE_ADDRESSING_MODE
9495  Example:
9496  <code>
9497  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode;
9498  sourceAddressMode = PLIB_DMA_ChannelXSourceAddressModeGet ( DMA_ID_0,
9499  DMA_CHANNEL_4 );
9500  </code>
9501  Remarks:
9502  This feature is not available on all devices. Please refer to the specific
9503  device data sheet to determine availability.
9504 */
9505 
9506 DMA_SOURCE_ADDRESSING_MODE
9508  DMA_MODULE_ID index ,
9509  DMA_CHANNEL channel ) ;
9510 //******************************************************************************
9511 /* Function:
9512  void PLIB_DMA_ChannelXDestinationAddressModeSelect (
9513  DMA_MODULE_ID index,
9514  DMA_CHANNEL channel,
9515  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode )
9516  Summary:
9517  Sets the source address mode of the specified channel.
9518  Description:
9519  This function Sets the source address mode of the specified channel.
9520  Precondition:
9521  None.
9522  Parameters:
9523  channel - One of the possible DMA channels listed by DMA_CHANNEL
9524  destinationAddressMode - One of the possible source addressing modes listed by
9525  DMA_DESTINATION_ADDRESSING_MODE
9526  Returns:
9527  None.
9528  Example:
9529  <code>
9530  PLIB_DMA_ChannelXDestinationAddressModeSelect (
9531  DMA_ID_0,
9532  DMA_CHANNEL_4,
9533  DMA_ADDRESSING_DESTINATION_INCREMENT_BASED_ON_SIZE );
9534  </code>
9535  Remarks:
9536  This feature is not available on all devices. Please refer to the specific
9537  device data sheet to determine availability.
9538 */
9539 
9540 void
9542  DMA_MODULE_ID index ,
9543  DMA_CHANNEL channel ,
9544  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode ) ;
9545 //******************************************************************************
9546 /* Function:
9547  DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet (
9548  DMA_MODULE_ID index,
9549  DMA_CHANNEL channel )
9550  Summary:
9551  Gets the source address mode of the specified channel.
9552  Description:
9553  This function gets the source address mode of the specified channel.
9554  Precondition:
9555  None.
9556  Parameters:
9557  channel - One of the possible DMA channels listed by DMA_CHANNEL
9558  Returns:
9559  - destinationAddressMode - One of the possible source addressing modes listed by
9560  DMA_DESTINATION_ADDRESSING_MODE
9561  Example:
9562  <code>
9563  DMA_SOURCE_ADDRESSING_MODE destinationAddressMode;
9564  destinationAddressMode = PLIB_DMA_ChannelXDestinationAddressModeGet (
9565  DMA_ID_0,
9566  DMA_CHANNEL_4 );
9567  </code>
9568  Remarks:
9569  This feature is not available on all devices. Please refer to the specific
9570  device data sheet to determine availability.
9571 */
9572 
9573 DMA_DESTINATION_ADDRESSING_MODE
9575  DMA_MODULE_ID index ,
9576  DMA_CHANNEL channel ) ;
9577 //******************************************************************************
9578 /* Function:
9579  void PLIB_DMA_ChannelXAddressModeSelect (
9580  DMA_MODULE_ID index,
9581  DMA_CHANNEL channel,
9582  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode )
9583  Summary:
9584  Sets the channel address mode.
9585  Description:
9586  This function sets the channel address mode.
9587  Precondition:
9588  None.
9589  Parameters:
9590  channel - One of the possible DMA channels listed by DMA_CHANNEL
9591  channelAddressMode - One of the possible channel addressing modes listed by
9592  DMA_CHANNEL_ADDRESSING_MODE
9593  Returns:
9594  None.
9595  Example:
9596  <code>
9597  PLIB_DMA_ChannelXAddressModeSelect (
9598  DMA_ID_0,
9599  DMA_CHANNEL_4,
9600  DMA_ADDRESSING_REGISTER_INDIRECT_WITH_POST_INCREMENT );
9601  </code>
9602  Remarks:
9603  This feature is not available on all devices. Please refer to the specific
9604  device data sheet to determine availability.
9605 */
9606 
9607 void
9609  DMA_MODULE_ID index ,
9610  DMA_CHANNEL channel ,
9611  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode ) ;
9612 //******************************************************************************
9613 /* Function:
9614  DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet (
9615  DMA_MODULE_ID index,
9616  DMA_CHANNEL channel )
9617  Summary:
9618  Gets the channel address mode.
9619  Description:
9620  This function gets the channel address mode.
9621  Precondition:
9622  None.
9623  Parameters:
9624  channel - One of the possible DMA channels listed by DMA_CHANNEL
9625  Returns:
9626  - channelAddressMode - One of the possible source addressing modes listed by
9627  DMA_CHANNEL_ADDRESSING_MODE
9628  Example:
9629  <code>
9630  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode;
9631  channelAddressMode = PLIB_DMA_ChannelXAddressModeGet ( DMA_ID_0,
9632  DMA_CHANNEL_4 );
9633  </code>
9634  Remarks:
9635  This feature is not available on all devices. Please refer to the specific
9636  device data sheet to determine availability.
9637 */
9638 
9639 DMA_CHANNEL_ADDRESSING_MODE
9641  DMA_MODULE_ID index ,
9642  DMA_CHANNEL channel ) ;
9643 // *****************************************************************************
9644 // *****************************************************************************
9645 // Section: DMA Channel Event Configuration functions
9646 // *****************************************************************************
9647 // *****************************************************************************
9648 //******************************************************************************
9649 /* Function:
9650  void PLIB_DMA_ChannelXTriggerEnable ( DMA_MODULE_ID index,
9651  DMA_CHANNEL channel,
9652  DMA_CHANNEL_TRIGGER_TYPE trigger )
9653  Summary:
9654  Enables the specified DMA channel trigger.
9655  Description:
9656  This function enables the specified DMA channel trigger.
9657  Precondition:
9658  None.
9659  Parameters:
9660  channel - One of the possible DMA channels listed by DMA_CHANNEL
9661  trigger - Type of trigger (transfer start/abort/pattern match abort)
9662  Returns:
9663  None.
9664  Example:
9665  <code>
9666  PLIB_DMA_ChannelXTriggerEnable ( DMA_ID_0,
9667  DMA_CHANNEL_4,
9668  DMA_CHANNEL_TRIGGER_TRANSFER_ABORT );
9669  </code>
9670  Remarks:
9671  This function implements an operation of the ChannelXTrigger feature.
9672  This feature may not be available on all devices. Please refer to the
9673  specific device data sheet to determine availability or use the
9674  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9675  determine whether this feature is available.
9676 */
9677 
9678 void
9680  DMA_MODULE_ID index ,
9681  DMA_CHANNEL channel ,
9682  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9683 //******************************************************************************
9684 /* Function:
9685  bool PLIB_DMA_ChannelXTriggerIsEnabled( DMA_MODULE_ID index,
9686  DMA_CHANNEL channel,
9687  DMA_CHANNEL_TRIGGER_TYPE trigger )
9688  Summary:
9689  Returns the enable status of the specified DMA transfer/abort trigger.
9690  Description:
9691  This function returns the enable status of the specified DMA transfer/abort trigger.
9692  Precondition:
9693  None.
9694  Parameters:
9695  channel - One of the possible DMA channels listed by DMA_CHANNEL
9696  trigger - Type of trigger (transfer start/abort/pattern match abort)
9697  Returns:
9698  - true - The specified trigger is enabled
9699  - false - The specified trigger is disabled
9700  Example:
9701  <code>
9702  bool startTriggerstatus;
9703  startTriggerstatus = PLIB_DMA_ChannelXTriggerIsEnabled (
9704  DMA_ID_0,
9705  DMA_CHANNEL_4,
9706  DMA_CHANNEL_TRIGGER_TRANSFER_START );
9707  </code>
9708  Remarks:
9709  This function implements an operation of the ChannelXTrigger feature.
9710  This feature may not be available on all devices. Please refer to the
9711  specific device data sheet to determine availability or use the
9712  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9713  determine whether this feature is available.
9714 */
9715 
9716 bool
9718  DMA_MODULE_ID index ,
9719  DMA_CHANNEL channel ,
9720  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9721 //******************************************************************************
9722 /* Function:
9723  void PLIB_DMA_ChannelXTriggerDisable ( DMA_MODULE_ID index,
9724  DMA_CHANNEL channel,
9725  DMA_CHANNEL_TRIGGER_TYPE trigger )
9726  Summary:
9727  Disables the DMA transfer abort via a matching interrupt (specified by the IRQ).
9728  Description:
9729  This function disables the DMA transfer abort via a matching interrupt
9730  (specified by the IRQ). The interrupt number IRQ is ignored and does not terminate
9731  a transfer.
9732  Precondition:
9733  None.
9734  Parameters:
9735  channel - One of the possible DMA channels listed by DMA_CHANNEL
9736  trigger - Type of trigger (transfer start/abort/pattern match abort)
9737  Returns:
9738  None.
9739  Example:
9740  <code>
9741  PLIB_DMA_ChannelXTriggerDisable ( DMA_ID_0,
9742  DMA_CHANNEL_4,
9743  DMA_CHANNEL_TRIGGER_PATTERN_MATCH_ABORT );
9744  </code>
9745  Remarks:
9746  This function implements an operation of the ChannelXTrigger feature.
9747  This feature may not be available on all devices. Please refer to the
9748  specific device data sheet to determine availability or use the
9749  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9750  determine whether this feature is available.
9751 */
9752 
9753 void
9755  DMA_MODULE_ID index ,
9756  DMA_CHANNEL channel ,
9757  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9758 //******************************************************************************
9759 /* Function:
9760  void PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_MODULE_ID index,
9761  DMA_CHANNEL channel)
9762  Summary:
9763  Gets the source number for the DMA channel interrupts.
9764  Description:
9765  This function returns the interrupt source number for the specified
9766  DMA channel.
9767  Precondition:
9768  None.
9769  Parameters:
9770  channel - One of the possible DMA channels listed by DMA_CHANNEL
9771  Returns:
9772  None.
9773  Example:
9774  <code>
9775  PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_ID_0,
9776  DMA_CHANNEL_4);
9777  </code>
9778  Remarks:
9779  This function implements an operation of the ChannelXTrigger feature.
9780  This feature may not be available on all devices. Please refer to the
9781  specific device data sheet to determine availability or use the
9782  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9783  determine whether this feature is available.
9784 */
9785 
9786 DMA_CHANNEL_INT_SOURCE
9788  DMA_MODULE_ID index ,
9789  DMA_CHANNEL channel ) ;
9790 //******************************************************************************
9791 /* Function:
9792  void PLIB_DMA_ChannelXStartIRQSet ( DMA_MODULE_ID index,
9793  DMA_CHANNEL channel,
9794  DMA_TRIGGER_SOURCE IRQnum )
9795  Summary:
9796  Sets the IRQ to initiate the DMA transfer on the specified channel.
9797  Description:
9798  This function sets the IRQ to initiate the DMA transfer on the specified channel.
9799  (IRQ to start the channel transfer.)
9800  Precondition:
9801  None.
9802  Parameters:
9803  channel - One of the possible DMA channels listed by DMA_CHANNEL
9804  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9805  Returns:
9806  None.
9807  Example:
9808  <code>
9809  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_OUTPUT_COMPARE_1;
9810  PLIB_DMA_ChannelXStartIRQSet ( DMA_ID_0,
9811  DMA_CHANNEL_4,
9812  irq );
9813  </code>
9814  Remarks:
9815  This function implements an operation of the ChannelXStartIRQ feature.
9816  This feature may not be available on all devices. Please refer to the
9817  specific device data sheet to determine availability or use the
9818  PLIB_DMA_ExistsChannelXStartIRQ function in your application to automatically
9819  determine whether this feature is available.
9820 */
9821 
9822 void
9824  DMA_MODULE_ID index ,
9825  DMA_CHANNEL channel ,
9826  DMA_TRIGGER_SOURCE IRQnum ) ;
9827 //******************************************************************************
9828 /* Function:
9829  void PLIB_DMA_ChannelXAbortIRQSet ( DMA_MODULE_ID index,
9830  DMA_CHANNEL channel,
9831  DMA_TRIGGER_SOURCE IRQ )
9832  Summary:
9833  Sets the IRQ to abort the DMA transfer on the specified channel.
9834  Description:
9835  This function sets the IRQ to abort the DMA transfer on the specified channel.
9836  (IRQ to start the channel transfer.)
9837  Precondition:
9838  None.
9839  Parameters:
9840  channel - One of the possible DMA channels listed by DMA_CHANNEL
9841  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9842  Returns:
9843  None.
9844  Example:
9845  <code>
9846  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_TIMER_CORE;
9847  PLIB_DMA_ChannelXAbortIRQSet ( DMA_ID_0,
9848  DMA_CHANNEL_4,
9849  irq );
9850  </code>
9851  Remarks:
9852  This function implements an operation of the ChannelXAbortIRQ feature.
9853  This feature may not be available on all devices. Please refer to the
9854  specific device data sheet to determine availability or use the
9855  PLIB_DMA_ExistsChannelXAbortIRQ function in your application to automatically
9856  determine whether this feature is available.
9857 */
9858 
9859 void
9861  DMA_MODULE_ID index ,
9862  DMA_CHANNEL channel ,
9863  DMA_TRIGGER_SOURCE IRQ ) ;
9864 //******************************************************************************
9865 /* Function:
9866  void PLIB_DMA_ChannelXDataSizeSelect ( DMA_MODULE_ID index,
9867  DMA_CHANNEL channel,
9868  DMA_CHANNEL_DATA_SIZE channelDataSize )
9869  Summary:
9870  Selects the data size for the specified channel.
9871  Description:
9872  This function selects the data size for the specified channel.
9873  Precondition:
9874  None.
9875  Parameters:
9876  channel - One of the possible DMA channels listed by DMA_CHANNEL
9877  channelDataSize - One of the possible data sizes listed by DMA_CHANNEL_DATA_SIZE
9878  Returns:
9879  None.
9880  Example:
9881  <code>
9882  DMA_CHANNEL_DATA_SIZE channelDataSize = DMA_CHANNEL_DATA_8;
9883  PLIB_DMA_ChannelXDataSizeSelect ( DMA_ID_0,
9884  DMA_CHANNEL_4,
9885  channelDataSize );
9886  </code>
9887  Remarks:
9888  This feature is not available on all devices. Please refer to the specific
9889  device data sheet to determine availability.
9890 */
9891 
9892 void
9894  DMA_MODULE_ID index ,
9895  DMA_CHANNEL channel ,
9896  DMA_CHANNEL_DATA_SIZE channelDataSize ) ;
9897 //******************************************************************************
9898 /* Function:
9899  DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet ( DMA_MODULE_ID index,
9900  DMA_CHANNEL channel )
9901  Summary:
9902  Returns the current data size for the specified channel.
9903  Description:
9904  This function returns the current data size for the specified channel.
9905  Precondition:
9906  None.
9907  Parameters:
9908  channel - One of the possible DMA channels listed by DMA_CHANNEL
9909  Returns:
9910  - channelDataSize - One of the possible data sizes listed by
9911  DMA_CHANNEL_DATA_SIZE
9912  Example:
9913  <code>
9914  DMA_CHANNEL_DATA_SIZE channelDataSize;
9915  channelDataSize = PLIB_DMA_ChannelXDataSizeGet( DMA_ID_0,
9916  DMA_CHANNEL_4 );
9917  </code>
9918  Remarks:
9919  This feature is not available on all devices. Please refer to the specific
9920  device data sheet to determine availability.
9921 */
9922 
9923 DMA_CHANNEL_DATA_SIZE
9925  DMA_MODULE_ID index ,
9926  DMA_CHANNEL channel ) ;
9927 //******************************************************************************
9928 /* Function:
9929  void PLIB_DMA_ChannelXOperatingTransferModeSelect (
9930  DMA_MODULE_ID index,
9931  DMA_CHANNEL channel,
9932  DMA_TRANSFER_MODE channeltransferMode )
9933  Summary:
9934  Selects the transfer/operating mode for the specified channel.
9935  Description:
9936  This function selects the transfer/operating mode for the specified channel.
9937  (Transfer mode and operating mode are used interchangeably.)
9938  Precondition:
9939  None.
9940  Parameters:
9941  channel - One of the possible DMA channels listed by DMA_CHANNEL
9942  channeltransferMode - One of the possible operating/transfer modes listed by
9943  DMA_TRANSFER_MODE
9944  Returns:
9945  None.
9946  Example:
9947  <code>
9948  DMA_TRANSFER_MODE channeltransferMode = DMA_MODE_REPEATED_CONTINUOUS;
9949  PLIB_DMA_ChannelXOperatingTransferModeSelect ( DMA_ID_0,
9950  DMA_CHANNEL_4,
9951  channeltransferMode );
9952  </code>
9953  Remarks:
9954  This feature is not available on all devices. Please refer to the specific
9955  device data sheet to determine availability.
9956 */
9957 
9958 void
9960  DMA_MODULE_ID index ,
9961  DMA_CHANNEL channel ,
9962  DMA_TRANSFER_MODE channeltransferMode ) ;
9963 //******************************************************************************
9964 /* Function:
9965  DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet (
9966  DMA_MODULE_ID index,
9967  DMA_CHANNEL channel )
9968  Summary:
9969  Returns the current transfer/operating mode for the specified channel.
9970  Description:
9971  This function returns the current transfer/operating mode for the specified channel.
9972  (Transfer mode and operating mode are used interchangeably.)
9973  Precondition:
9974  None.
9975  Parameters:
9976  channel - One of the possible DMA channels listed by DMA_CHANNEL
9977  Returns:
9978  - channeltransferMode - One of the possible operating/transfer modes listed
9979  by DMA_TRANSFER_MODE
9980  Example:
9981  <code>
9982  DMA_TRANSFER_MODE channeltransferMode;
9983  channeltransferMode = PLIB_DMA_ChannelXOperatingTransferModeGet (
9984  DMA_ID_0,
9985  DMA_CHANNEL_4 );
9986  </code>
9987  Remarks:
9988  This feature is not available on all devices. Please refer to the specific
9989  device data sheet to determine availability.
9990 */
9991 
9992 DMA_TRANSFER_MODE
9994  DMA_MODULE_ID index ,
9995  DMA_CHANNEL channel ) ;
9996 //******************************************************************************
9997 /* Function:
9998  void PLIB_DMA_ChannelXReloadEnable( DMA_MODULE_ID index,
9999  DMA_CHANNEL channel )
10000  Summary:
10001  Enables reloading of the address and count registers.
10002  Description:
10003  This function enables reloading of the address and count registers. The source,
10004  destination address, and the DMA count registers are reloaded to their previous
10005  values upon the start of the next operation.
10006  Precondition:
10007  None.
10008  Parameters:
10009  channel - One of the possible DMA channels listed by DMA_CHANNEL
10010  Returns:
10011  None.
10012  Example:
10013  <code>
10014  PLIB_DMA_ChannelXReloadEnable ( DMA_ID_0,
10015  DMA_CHANNEL_4 );
10016  </code>
10017  Remarks:
10018  This feature is not available on all devices. Please refer to the specific
10019  device data sheet to determine availability.
10020 */
10021 
10022 void
10024  DMA_MODULE_ID index ,
10025  DMA_CHANNEL channel ) ;
10026 //******************************************************************************
10027 /* Function:
10028  bool PLIB_DMA_ChannelXReloadIsEnabled ( DMA_MODULE_ID index,
10029  DMA_CHANNEL channel )
10030  Summary:
10031  Returns the address and count registers reload enable status.
10032  Description:
10033  This function returns the address and count registers reload enable status.
10034  Precondition:
10035  None.
10036  Parameters:
10037  channel - One of the possible DMA channels listed by DMA_CHANNEL
10038  Returns:
10039  - true - The address and count registers reload is enabled
10040  - false - The address and count registers reload is disabled
10041  Example:
10042  <code>
10043  bool chAddressCountReloadStatus;
10044  chAddressCountReloadStatus = PLIB_DMA_ChannelXReloadIsEnabled (
10045  DMA_ID_0,
10046  DMA_CHANNEL_4 );
10047  </code>
10048  Remarks:
10049  This feature is not available on all devices. Please refer to the specific
10050  device data sheet to determine availability.
10051 */
10052 
10053 bool
10055  DMA_MODULE_ID index ,
10056  DMA_CHANNEL channel ) ;
10057 //******************************************************************************
10058 /* Function:
10059  void PLIB_DMA_ChannelXReloadDisable ( DMA_MODULE_ID index,
10060  DMA_CHANNEL channel )
10061  Summary:
10062  Disables reloading of the address and count registers.
10063  Description:
10064  This function disables reloading of the address and count registers. The source, destination
10065  address, and the DMA count registers are not reloaded to their previous values upon
10066  the start of the next operation.
10067  Precondition:
10068  None.
10069  Parameters:
10070  channel - One of the possible DMA channels listed by DMA_CHANNEL
10071  Returns:
10072  None.
10073  Example:
10074  <code>
10075  PLIB_DMA_ChannelXReloadDisable ( DMA_ID_0,
10076  DMA_CHANNEL_4 );
10077  </code>
10078  Remarks:
10079  This feature is not available on all devices. Please refer to the specific
10080  device data sheet to determine availability.
10081 */
10082 
10083 void
10085  DMA_MODULE_ID index ,
10086  DMA_CHANNEL channel ) ;
10087 //******************************************************************************
10088 /* Function:
10089  void PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_MODULE_ID index,
10090  DMA_CHANNEL channel )
10091  Summary:
10092  Enables the Null Write mode.
10093  Description:
10094  This function enables the Null Write mode. A dummy write is initiated to the
10095  source address for every write to the destination address.
10096  Precondition:
10097  None.
10098  Parameters:
10099  channel - One of the possible DMA channels listed by DMA_CHANNEL
10100  Returns:
10101  None.
10102  Example:
10103  <code>
10104  PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_ID_0,
10105  DMA_CHANNEL_4 );
10106  </code>
10107  Remarks:
10108  This feature is not available on all devices. Please refer to the specific
10109  device data sheet to determine availability.
10110 */
10111 
10112 void
10114  DMA_MODULE_ID index ,
10115  DMA_CHANNEL channel ) ;
10116 //******************************************************************************
10117 /* Function:
10118  bool PLIB_DMA_ChannelXNullWriteModeIsEnabled ( DMA_MODULE_ID index,
10119  DMA_CHANNEL channel )
10120  Summary:
10121  Returns the enable status of the Null Write mode for the specified channel.
10122  Description:
10123  This function returns the enable status of the Null Write mode for the specified channel.
10124  Precondition:
10125  None.
10126  Parameters:
10127  channel - One of the possible DMA channels listed by DMA_CHANNEL
10128  Returns:
10129  - true - Null write mode is enabled for this channel
10130  - false - Null write mode is disabled for this channel
10131  Example:
10132  <code>
10133  bool chNullWriteStatus;
10134  chNullWriteStatus = PLIB_DMA_ChannelXNullWriteModeIsEnabled (
10135  DMA_ID_0,
10136  DMA_CHANNEL_4 );
10137  </code>
10138  Remarks:
10139  This feature is not available on all devices. Please refer to the specific
10140  device data sheet to determine availability.
10141 */
10142 
10143 bool
10145  DMA_MODULE_ID index ,
10146  DMA_CHANNEL channel ) ;
10147 //******************************************************************************
10148 /* Function:
10149  void PLIB_DMA_ChannelXNullWriteModeDisable( DMA_MODULE_ID index,
10150  DMA_CHANNEL channel )
10151  Summary:
10152  Disables the Null Write mode.
10153  Description:
10154  This function disables the Null Write mode. No dummy write is initiated.
10155  Precondition:
10156  None.
10157  Parameters:
10158  channel - One of the possible DMA channels listed by DMA_CHANNEL
10159  Returns:
10160  None.
10161  Example:
10162  <code>
10163  PLIB_DMA_ChannelXNullWriteModeDisable ( DMA_ID_0,
10164  DMA_CHANNEL_4 );
10165  </code>
10166  Remarks:
10167  This feature is not available on all devices. Please refer to the specific
10168  device data sheet to determine availability.
10169 */
10170 
10171 void
10173  DMA_MODULE_ID index ,
10174  DMA_CHANNEL channel ) ;
10175 // *****************************************************************************
10176 // *****************************************************************************
10177 // Section: DMA start/end functions
10178 // *****************************************************************************
10179 // *****************************************************************************
10180 //******************************************************************************
10181 /* Function:
10182  void PLIB_DMA_StartTransferSet ( DMA_MODULE_ID index,
10183  DMA_CHANNEL channel )
10184  Summary:
10185  Initiates transfer on the specified channel.
10186  Description:
10187  This function initiates transfer on the specified channel. This is a forced transfer
10188  controlled via software.
10189  Precondition:
10190  None.
10191  Parameters:
10192  channel - One of the possible DMA channels listed by DMA_CHANNEL
10193  Returns:
10194  None.
10195  Example:
10196  <code>
10197  PLIB_DMA_StartTransferSet ( DMA_ID_0,
10198  DMA_CHANNEL_4 );
10199  </code>
10200  Remarks:
10201  This function implements an operation of the StartTransfer feature.
10202  This feature may not be available on all devices. Please refer to the
10203  specific device data sheet to determine availability or use the
10204  PLIB_DMA_ExistsStartTransfer function in your application to automatically
10205  determine whether this feature is available.
10206 */
10207 
10208 void
10210  DMA_MODULE_ID index ,
10211  DMA_CHANNEL channel ) ;
10212 //******************************************************************************
10213 /* Function:
10214  void PLIB_DMA_AbortTransferSet ( DMA_MODULE_ID index,
10215  DMA_CHANNEL channel )
10216  Summary:
10217  Aborts transfer on the specified channel.
10218  Description:
10219  This function aborts transfer on the specified channel. This is a forced abort
10220  controlled via software.
10221  Precondition:
10222  None.
10223  Parameters:
10224  channel - One of the possible DMA channels listed by DMA_CHANNEL
10225  Returns:
10226  None.
10227  Example:
10228  <code>
10229  PLIB_DMA_AbortTransferSet ( DMA_ID_0,
10230  DMA_CHANNEL_4 );
10231  </code>
10232  Remarks:
10233  This function implements an operation of the AbortTransfer feature.
10234  This feature may not be available on all devices. Please refer to the
10235  specific device data sheet to determine availability or use the
10236  PLIB_DMA_ExistsAbortTransfer function in your application to automatically
10237  determine whether this feature is available.
10238 */
10239 
10240 void
10242  DMA_MODULE_ID index ,
10243  DMA_CHANNEL channel ) ;
10244 // *****************************************************************************
10245 // *****************************************************************************
10246 // Section: DMA General Configuration functions
10247 // *****************************************************************************
10248 // *****************************************************************************
10249 //******************************************************************************
10250 /* Function:
10251  void PLIB_DMA_BusyActiveSet ( DMA_MODULE_ID index )
10252  Summary:
10253  Sets the BUSY bit of the DMA controller.
10254  Description:
10255  This function sets the BUSY bit of the DMA controller. The DMA module is active.
10256  Precondition:
10257  None.
10258  Parameters:
10259  None.
10260  Returns:
10261  None.
10262  Example:
10263  <code>
10264  PLIB_DMA_BusyActiveSet( DMA_ID_0 );
10265  </code>
10266  Remarks:
10267  This function implements an operation of the Busy feature.
10268  This feature may not be available on all devices. Please refer to the
10269  specific device data sheet to determine availability or use the
10270  PLIB_DMA_ExistsBusy function in your application to automatically
10271  determine whether this feature is available.
10272 */
10273 
10274 void
10276  DMA_MODULE_ID index ) ;
10277 //******************************************************************************
10278 /* Function:
10279  void PLIB_DMA_BusyActiveReset ( DMA_MODULE_ID index )
10280  Summary:
10281  Resets the BUSY bit of the DMA controller.
10282  Description:
10283  This function resets the BUSY bit of the DMA controller. The DMA module is
10284  disabled and is not actively transferring data.
10285  Precondition:
10286  None.
10287  Parameters:
10288  None.
10289  Returns:
10290  None.
10291  Example:
10292  <code>
10293  PLIB_DMA_BusyActiveReset( DMA_ID_0 );
10294  </code>
10295  Remarks:
10296  This function implements an operation of the Busy feature.
10297  This feature may not be available on all devices. Please refer to the
10298  specific device data sheet to determine availability or use the
10299  PLIB_DMA_ExistsBusy function in your application to automatically
10300  determine whether this feature is available.
10301 */
10302 
10303 void
10305  DMA_MODULE_ID index ) ;
10306 //******************************************************************************
10307 /* Function:
10308  bool PLIB_DMA_IsBusy ( DMA_MODULE_ID index )
10309  Summary:
10310  Gets the BUSY bit of the DMA controller.
10311  Description:
10312  This function gets the BUSY bit of the DMA controller.
10313  Precondition:
10314  None.
10315  Parameters:
10316  None.
10317  Returns:
10318  - true - DMA module is active
10319  - false - DMA module is disabled and is not actively transferring data
10320  Example:
10321  <code>
10322  bool dmaBusyStatus;
10323  dmaBusyStatus = PLIB_DMA_IsBusy( DMA_ID_0 );
10324  </code>
10325  Remarks:
10326  This function implements an operation of the Busy feature.
10327  This feature may not be available on all devices. Please refer to the
10328  specific device data sheet to determine availability or use the
10329  PLIB_DMA_ExistsBusy function in your application to automatically
10330  determine whether this feature is available.
10331 */
10332 
10333 bool
10334  PLIB_DMA_IsBusy (
10335  DMA_MODULE_ID index ) ;
10336 //******************************************************************************
10337 /* Function:
10338  void PLIB_DMA_SuspendEnable ( DMA_MODULE_ID index )
10339  Summary:
10340  DMA transfers are suspended to allow uninterrupted access by the CPU to the data bus.
10341  Description:
10342  This function suspends the DMA transfers to allow uninterrupted access
10343  by the CPU to the data bus.
10344  Precondition:
10345  None.
10346  Parameters:
10347  None.
10348  Returns:
10349  None.
10350  Example:
10351  <code>
10352  PLIB_DMA_SuspendEnable( DMA_ID_0 );
10353  </code>
10354  Remarks:
10355  This function implements an operation of the Suspend feature.
10356  This feature may not be available on all devices. Please refer to the
10357  specific device data sheet to determine availability or use the
10358  PLIB_DMA_ExistsSuspend function in your application to automatically
10359  determine whether this feature is available.
10360 */
10361 
10362 void
10364  DMA_MODULE_ID index ) ;
10365 //******************************************************************************
10366 /* Function:
10367  void PLIB_DMA_SuspendDisable ( DMA_MODULE_ID index )
10368  Summary:
10369  DMA suspend is disabled and the DMA module operates normally.
10370  Description:
10371  This function disables the DMA suspend. The DMA module continues to operate
10372  normally.
10373  Precondition:
10374  None.
10375  Parameters:
10376  None.
10377  Returns:
10378  None.
10379  Example:
10380  <code>
10381  PLIB_DMA_SuspendDisable( DMA_ID_0 );
10382  </code>
10383  Remarks:
10384  This function implements an operation of the Suspend feature.
10385  This feature may not be available on all devices. Please refer to the
10386  specific device data sheet to determine availability or use the
10387  PLIB_DMA_ExistsSuspend function in your application to automatically
10388  determine whether this feature is available.
10389 */
10390 
10391 void
10393  DMA_MODULE_ID index ) ;
10394 //******************************************************************************
10395 /* Function:
10396  bool PLIB_DMA_SuspendIsEnabled ( DMA_MODULE_ID index )
10397  Summary:
10398  Returns the DMA suspend status.
10399  Description:
10400  This function returns the DMA suspend status.
10401  Precondition:
10402  None.
10403  Parameters:
10404  None.
10405  Returns:
10406  - true - The DMA transfers are suspended
10407  - false - The DMA operates normally
10408  Example:
10409  <code>
10410  bool dmaSuspendStatus;
10411  dmaSuspendStatus = PLIB_DMA_SuspendIsEnabled( DMA_ID_0 );
10412  </code>
10413  Remarks:
10414  This function implements an operation of the Suspend feature.
10415  This feature may not be available on all devices. Please refer to the
10416  specific device data sheet to determine availability or use the
10417  PLIB_DMA_ExistsSuspend function in your application to automatically
10418  determine whether this feature is available.
10419 */
10420 
10421 bool
10423  DMA_MODULE_ID index ) ;
10424 //******************************************************************************
10425 /* Function:
10426  void PLIB_DMA_StopInIdleEnable ( DMA_MODULE_ID index )
10427  Summary:
10428  DMA transfers are halted during Idle mode.
10429  Description:
10430  This function halts DMA transfers during Idle mode.
10431  Precondition:
10432  None.
10433  Parameters:
10434  None.
10435  Returns:
10436  None.
10437  Example:
10438  <code>
10439  PLIB_DMA_StopInIdleEnable( DMA_ID_0 );
10440  </code>
10441  Remarks:
10442  This function implements an operation of the StopInIdle feature.
10443  This feature may not be available on all devices. Please refer to the
10444  specific device data sheet to determine availability or use the
10445  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10446  determine whether this feature is available.
10447 */
10448 
10449 void
10451  DMA_MODULE_ID index ) ;
10452 //******************************************************************************
10453 /* Function:
10454  void PLIB_DMA_StopInIdleDisable ( DMA_MODULE_ID index )
10455  Summary:
10456  DMA transfers continue during Idle mode.
10457  Description:
10458  This function causes DMA transfers to continue during Idle mode.
10459  Precondition:
10460  None.
10461  Parameters:
10462  None.
10463  Returns:
10464  None.
10465  Example:
10466  <code>
10467  PLIB_DMA_StopInIdleDisable( DMA_ID_0 );
10468  </code>
10469  Remarks:
10470  This function implements an operation of the StopInIdle feature.
10471  This feature may not be available on all devices. Please refer to the
10472  specific device data sheet to determine availability or use the
10473  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10474  determine whether this feature is available.
10475 */
10476 
10477 void
10479  DMA_MODULE_ID index ) ;
10480 //******************************************************************************
10481 /* Function:
10482  void PLIB_DMA_Enable ( DMA_MODULE_ID index )
10483  Summary:
10484  DMA module is enabled.
10485  Description:
10486  This function enables the DMA module.
10487  Precondition:
10488  None.
10489  Parameters:
10490  None.
10491  Returns:
10492  None.
10493  Example:
10494  <code>
10495  PLIB_DMA_Enable( DMA_ID_0 );
10496  </code>
10497  Remarks:
10498  This function implements an operation of the EnableControl feature.
10499  This feature may not be available on all devices. Please refer to the
10500  specific device data sheet to determine availability or use the
10501  PLIB_DMA_ExistsEnableControl function in your application to automatically
10502  determine whether this feature is available.
10503 */
10504 
10505 void
10506  PLIB_DMA_Enable (
10507  DMA_MODULE_ID index ) ;
10508 //******************************************************************************
10509 /* Function:
10510  bool PLIB_DMA_IsEnabled ( DMA_MODULE_ID index )
10511  Summary:
10512  Returns the DMA module enable status.
10513  Description:
10514  This function returns the DMA module enable status.
10515  Precondition:
10516  None.
10517  Parameters:
10518  None.
10519  Returns:
10520  - true - The DMA is enabled
10521  - false - The DMA is disabled
10522  Example:
10523  <code>
10524  PLIB_DMA_IsEnabled( DMA_ID_0 );
10525  </code>
10526  Remarks:
10527  This function implements an operation of the EnableControl feature.
10528  This feature may not be available on all devices. Please refer to the
10529  specific device data sheet to determine availability or use the
10530  PLIB_DMA_ExistsEnableControl function in your application to automatically
10531  determine whether this feature is available.
10532 */
10533 
10534 bool
10536  DMA_MODULE_ID index ) ;
10537 //******************************************************************************
10538 /* Function:
10539  void PLIB_DMA_Disable ( DMA_MODULE_ID index )
10540  Summary:
10541  DMA module is disabled.
10542  Description:
10543  This function disables the DMA module.
10544  Precondition:
10545  None.
10546  Parameters:
10547  None.
10548  Returns:
10549  None.
10550  Example:
10551  <code>
10552  PLIB_DMA_Disable( DMA_ID_0 );
10553  </code>
10554  Remarks:
10555  This function implements an operation of the EnableControl feature.
10556  This feature may not be available on all devices. Please refer to the
10557  specific device data sheet to determine availability or use the
10558  PLIB_DMA_ExistsEnableControl function in your application to automatically
10559  determine whether this feature is available.
10560 */
10561 
10562 void
10564  DMA_MODULE_ID index ) ;
10565 // *****************************************************************************
10566 // *****************************************************************************
10567 // Section: DMA status functions
10568 // *****************************************************************************
10569 // *****************************************************************************
10570 //******************************************************************************
10571 /* Function:
10572  uint8_t PLIB_DMA_ChannelBitsGet ( DMA_MODULE_ID index )
10573  Summary:
10574  Returns the DMA channel bits.
10575  Description:
10576  This function returns the channel bits.
10577  Precondition:
10578  None.
10579  Parameters:
10580  None.
10581  Returns:
10582  - uint8_t - DMA channel bits
10583  Example:
10584  <code>
10585  uint8_t dmaChBits;
10586  dmaChBits = PLIB_DMA_ChannelBitsGet( DMA_ID_0 );
10587  </code>
10588  Remarks:
10589  This function implements an operation of the ChannelBits feature.
10590  This feature may not be available on all devices. Please refer to the
10591  specific device data sheet to determine availability or use the
10592  PLIB_DMA_ExistsChannelBits function in your application to automatically
10593  determine whether this feature is available.
10594 */
10595 
10596 uint8_t
10598  DMA_MODULE_ID index ) ;
10599 //******************************************************************************
10600 /* Function:
10601  bool PLIB_DMA_LastBusAccessIsRead ( DMA_MODULE_ID index )
10602  Summary:
10603  Returns true if the last DMA bus access was a read.
10604  Description:
10605  This function returns true if the last DMA bus access was a read.
10606  Precondition:
10607  None.
10608  Parameters:
10609  None.
10610  Returns:
10611  - true - The last bus access was a read
10612  - false - The last bus access was not a read
10613  Example:
10614  <code>
10615  bool dmaLastBusAccessType;
10616  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsRead( DMA_ID_0 );
10617  </code>
10618  Remarks:
10619  This function implements an operation of the LastBusAccess feature.
10620  This feature may not be available on all devices. Please refer to the
10621  specific device data sheet to determine availability or use the
10622  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10623  determine whether this feature is available.
10624 */
10625 
10626 bool
10628  DMA_MODULE_ID index ) ;
10629 //******************************************************************************
10630 /* Function:
10631  bool PLIB_DMA_LastBusAccessIsWrite ( DMA_MODULE_ID index )
10632  Summary:
10633  Returns true if the last DMA bus access was a write.
10634  Description:
10635  This function returns true if the last DMA bus access was a write operation.
10636  Precondition:
10637  None.
10638  Parameters:
10639  None.
10640  Returns:
10641  - true - The last bus access was a write operation
10642  - false - The last bus access was not a write operation
10643  Example:
10644  <code>
10645  bool dmaLastBusAccessType;
10646  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsWrite( DMA_ID_0 );
10647  </code>
10648  Remarks:
10649  This function implements an operation of the LastBusAccess feature.
10650  This feature may not be available on all devices. Please refer to the
10651  specific device data sheet to determine availability or use the
10652  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10653  determine whether this feature is available.
10654 */
10655 
10656 bool
10658  DMA_MODULE_ID index ) ;
10659 //******************************************************************************
10660 /* Function:
10661  uint32_t PLIB_DMA_RecentAddressAccessed ( DMA_MODULE_ID index )
10662  Summary:
10663  Returns the address of the most recent DMA access.
10664  Description:
10665  This function returns the address of the most recent DMA access.
10666  Precondition:
10667  None.
10668  Parameters:
10669  None.
10670  Returns:
10671  - uint32_t - The most recent address accessed by the DMA
10672  Example:
10673  <code>
10674  uint32_t dmaLastAddressAccessed;
10675  dmaLastAddressAccessed = PLIB_DMA_RecentAddressAccessed( DMA_ID_0 );
10676  </code>
10677  Remarks:
10678  This function implements an operation of the RecentAddress feature.
10679  This feature may not be available on all devices. Please refer to the
10680  specific device data sheet to determine availability or use the
10681  PLIB_DMA_ExistsRecentAddress function in your application to automatically
10682  determine whether this feature is available.
10683 */
10684 
10685 uint32_t
10687  DMA_MODULE_ID index ) ;
10688 // *****************************************************************************
10689 // *****************************************************************************
10690 // Section: DMA Module CRC Feature Interface Functions
10691 // *****************************************************************************
10692 // *****************************************************************************
10693 //******************************************************************************
10694 /* Function:
10695  void PLIB_DMA_CRCChannelSelect( DMA_MODULE_ID index,
10696  DMA_CHANNEL channel )
10697  Summary:
10698  Assigns the CRC to the specified DMA channel.
10699  Description:
10700  This function assigns the CRC feature to the specified channel.
10701  Precondition:
10702  None.
10703  Parameters:
10704  channel - One of the possible DMA channels listed by DMA_CHANNEL
10705  Returns:
10706  None.
10707  Example:
10708  <code>
10709  PLIB_DMA_CRCChannelSelect( DMA_ID_0,
10710  DMA_CHANNEL_5 );
10711  </code>
10712  Remarks:
10713  This function implements an operation of the CRCChannel feature.
10714  This feature may not be available on all devices. Please refer to the
10715  specific device data sheet to determine availability or use the
10716  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10717  determine whether this feature is available.
10718 */
10719 
10720 void
10722  DMA_MODULE_ID index ,
10723  DMA_CHANNEL channel ) ;
10724 //******************************************************************************
10725 /* Function:
10726  DMA_CHANNEL PLIB_DMA_CRCChannelGet ( DMA_MODULE_ID index )
10727  Summary:
10728  Returns the current DMA channel to which the CRC is assigned.
10729  Description:
10730  This function returns the current DMA channel to which the CRC is assigned.
10731  Precondition:
10732  None.
10733  Parameters:
10734  None.
10735  Returns:
10736  crcChannel - One of the possible DMA channels listed by DMA_CHANNEL
10737  Example:
10738  <code>
10739  DMA_CHANNEL crcChannel;
10740  crcChannel = PLIB_DMA_CRCChannelGet( DMA_ID_0 );
10741  </code>
10742  Remarks:
10743  This function implements an operation of the CRCChannel feature.
10744  This feature may not be available on all devices. Please refer to the
10745  specific device data sheet to determine availability or use the
10746  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10747  determine whether this feature is available.
10748 */
10749 
10750 DMA_CHANNEL
10752  DMA_MODULE_ID index ) ;
10753 //******************************************************************************
10754 /* Function:
10755  void PLIB_DMA_CRCTypeSet ( DMA_MODULE_ID index,
10756  DMA_CRC_TYPE CRCType )
10757  Summary:
10758  Selects the DMA module CRC feature type.
10759  Description:
10760  This function selects the DMA module CRC feature type. The CRC feature will
10761  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10762  checksum.
10763  Precondition:
10764  None.
10765  Parameters:
10766  CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE
10767  Returns:
10768  None.
10769  Example:
10770  <code>
10771  PLIB_DMA_CRCTypeSet(DMA_ID_0,
10772  DMA_CRC_IP_HEADER );
10773  </code>
10774  Remarks:
10775  This function implements an operation of the CRCType feature.
10776  This feature may not be available on all devices. Please refer to the
10777  specific device data sheet to determine availability or use the
10778  PLIB_DMA_ExistsCRCType function in your application to automatically
10779  determine whether this feature is available.
10780 */
10781 
10782 void
10784  DMA_MODULE_ID index ,
10785  DMA_CRC_TYPE CRCType ) ;
10786 //******************************************************************************
10787 /* Function:
10788  DMA_CRC_TYPE PLIB_DMA_CRCTypeGet ( DMA_MODULE_ID index )
10789  Summary:
10790  Gets the current DMA module CRC feature type.
10791  Description:
10792  This function gets the DMA module CRC feature type. The CRC feature will
10793  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10794  checksum.
10795  Precondition:
10796  None.
10797  Parameters:
10798  None.
10799  Returns:
10800  - CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE.
10801  Example:
10802  <code>
10803  DMA_CRC_TYPE CRCType;
10804  CRCType = PLIB_DMA_CRCTypeGet( DMA_ID_0 );
10805  </code>
10806  Remarks:
10807  This function implements an operation of the CRCType feature.
10808  This feature may not be available on all devices. Please refer to the
10809  specific device data sheet to determine availability or use the
10810  PLIB_DMA_ExistsCRCType function in your application to automatically
10811  determine whether this feature is available.
10812 */
10813 
10814 DMA_CRC_TYPE
10816  DMA_MODULE_ID index ) ;
10817 //******************************************************************************
10818 /* Function:
10819  void PLIB_DMA_CRCAppendModeEnable ( DMA_MODULE_ID index )
10820  Summary:
10821  Enables the CRC append mode.
10822  Description:
10823  This function enables the CRC append mode. The DMA transfers data from the source
10824  into the CRC, but not to the destination. When a block transfer completes, the
10825  DMA writes the calculated CRC value to the location specified by the CHxDSA register.
10826  Precondition:
10827  None.
10828  Parameters:
10829  None.
10830  Returns:
10831  None.
10832  Example:
10833  <code>
10834  PLIB_DMA_CRCAppendModeEnable( DMA_ID_0 );
10835  </code>
10836  Remarks:
10837  This function implements an operation of the CRCAppendMode feature.
10838  This feature may not be available on all devices. Please refer to the
10839  specific device data sheet to determine availability or use the
10840  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10841  determine whether this feature is available.
10842 */
10843 
10844 void
10846  DMA_MODULE_ID index ) ;
10847 //******************************************************************************
10848 /* Function:
10849  bool PLIB_DMA_CRCAppendModeIsEnabled ( DMA_MODULE_ID index )
10850  Summary:
10851  Gets the enable status of the CRC append mode.
10852  Description:
10853  This function gets the enable status of the CRC append mode.
10854  Precondition:
10855  None.
10856  Parameters:
10857  None.
10858  Returns:
10859  - true - CRC append mode is enabled
10860  - false - CRC append mode is disabled
10861  Example:
10862  <code>
10863  bool DMAcrcAppendMode;
10864  DMAcrcAppendMode = PLIB_DMA_CRCAppendModeIsEnabled( DMA_ID_0 );
10865  </code>
10866  Remarks:
10867  This function implements an operation of the CRCAppendMode feature.
10868  This feature may not be available on all devices. Please refer to the
10869  specific device data sheet to determine availability or use the
10870  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10871  determine whether this feature is available.
10872 */
10873 
10874 bool
10876  DMA_MODULE_ID index ) ;
10877 //******************************************************************************
10878 /* Function:
10879  void PLIB_DMA_CRCAppendModeDisable ( DMA_MODULE_ID index )
10880  Summary:
10881  Disables the CRC append mode.
10882  Description:
10883  This function disables the CRC append mode. The DMA transfers data from the
10884  source through the CRC obeying WBO (DMA_MODULE_ID index, write byte order)
10885  as it writes the data to the destination.
10886  Precondition:
10887  None.
10888  Parameters:
10889  None.
10890  Returns:
10891  None.
10892  Example:
10893  <code>
10894  PLIB_DMA_CRCAppendModeDisable( DMA_ID_0 );
10895  </code>
10896  Remarks:
10897  This function implements an operation of the CRCAppendMode feature.
10898  This feature may not be available on all devices. Please refer to the
10899  specific device data sheet to determine availability or use the
10900  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10901  determine whether this feature is available.
10902 */
10903 
10904 void
10906  DMA_MODULE_ID index ) ;
10907 //******************************************************************************
10908 /* Function:
10909  void PLIB_DMA_CRCEnable ( DMA_MODULE_ID index )
10910  Summary:
10911  Enables the DMA module CRC feature.
10912  Description:
10913  This function enables the DMA module CRC feature. The channel transfers are
10914  routed through the CRC.
10915  Precondition:
10916  None.
10917  Parameters:
10918  None.
10919  Returns:
10920  None.
10921  Example:
10922  <code>
10923  PLIB_DMA_CRCEnable( DMA_ID_0 );
10924  </code>
10925  Remarks:
10926  This function implements an operation of the CRC feature.
10927  This feature may not be available on all devices. Please refer to the
10928  specific device data sheet to determine availability or use the
10929  PLIB_DMA_ExistsCRC function in your application to automatically
10930  determine whether this feature is available.
10931 */
10932 
10933 void
10935  DMA_MODULE_ID index ) ;
10936 //******************************************************************************
10937 /* Function:
10938  bool PLIB_DMA_CRCIsEnabled ( DMA_MODULE_ID index )
10939  Summary:
10940  Gets the enable status of the CRC feature.
10941  Description:
10942  This function gets the enable status of the CRC feature.
10943  Precondition:
10944  None.
10945  Parameters:
10946  None.
10947  Returns:
10948  - true - The CRC feature is enabled
10949  - false - The CRC feature is disabled
10950  Example:
10951  <code>
10952  bool DMAcrcStatus;
10953  DMAcrcStatus = PLIB_DMA_CRCIsEnabled( DMA_ID_0 );
10954  </code>
10955  Remarks:
10956  This function implements an operation of the CRC feature.
10957  This feature may not be available on all devices. Please refer to the
10958  specific device data sheet to determine availability or use the
10959  PLIB_DMA_ExistsCRC function in your application to automatically
10960  determine whether this feature is available.
10961 */
10962 
10963 bool
10965  DMA_MODULE_ID index ) ;
10966 //******************************************************************************
10967 /* Function:
10968  void PLIB_DMA_CRCDisable ( DMA_MODULE_ID index )
10969  Summary:
10970  Disables the DMA module CRC feature.
10971  Description:
10972  This function disables the DMA module CRC feature. The channel transfers proceed
10973  normally.
10974  Precondition:
10975  None.
10976  Parameters:
10977  None.
10978  Returns:
10979  None.
10980  Example:
10981  <code>
10982  PLIB_DMA_CRCDisable( DMA_ID_0 );
10983  </code>
10984  Remarks:
10985  This function implements an operation of the CRC feature.
10986  This feature may not be available on all devices. Please refer to the
10987  specific device data sheet to determine availability or use the
10988  PLIB_DMA_ExistsCRC function in your application to automatically
10989  determine whether this feature is available.
10990 */
10991 
10992 void
10994  DMA_MODULE_ID index ) ;
10995 //******************************************************************************
10996 /* Function:
10997  void PLIB_DMA_CRCPolynomialLengthSet ( DMA_MODULE_ID index,
10998  uint8_t polyLength )
10999  Summary:
11000  Selects the polynomial length.
11001  Description:
11002  This function Selects the polynomial length.
11003  Precondition:
11004  None.
11005  Parameters:
11006  polyLength - Polynomial length
11007  Returns:
11008  None.
11009  Example:
11010  <code>
11011  uint8_t polyLength = 0x2;
11012  PLIB_DMA_CRCPolynomialLengthSet( DMA_ID_0, polyLength );
11013  </code>
11014  Remarks:
11015  This function implements an operation of the CRCPolynomialLength feature.
11016  This feature may not be available on all devices. Please refer to the
11017  specific device data sheet to determine availability or use the
11018  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
11019  determine whether this feature is available.
11020 */
11021 
11022 void
11024  DMA_MODULE_ID index ,
11025  uint8_t polyLength ) ;
11026 //******************************************************************************
11027 /* Function:
11028  uint8_t PLIB_DMA_CRCPolynomialLengthGet ( DMA_MODULE_ID index )
11029  Summary:
11030  Gets the current polynomial length.
11031  Description:
11032  This function gets the current polynomial length.
11033  Precondition:
11034  None.
11035  Parameters:
11036  None.
11037  Returns:
11038  - uint8_t - Polynomial length
11039  Example:
11040  <code>
11041  uint8_t polyLength;
11042  polyLength = PLIB_DMA_CRCPolynomialLengthGet( DMA_ID_0 );
11043  </code>
11044  Remarks:
11045  This function implements an operation of the CRCPolynomialLength feature.
11046  This feature may not be available on all devices. Please refer to the
11047  specific device data sheet to determine availability or use the
11048  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
11049  determine whether this feature is available.
11050 */
11051 
11052 uint8_t
11054  DMA_MODULE_ID index ) ;
11055 //******************************************************************************
11056 /* Function:
11057  void PLIB_DMA_CRCBitOrderSelect ( DMA_MODULE_ID index,
11058  DMA_CRC_BIT_ORDER bitOrder )
11059  Summary:
11060  Selects the bit order for checksum calculation.
11061  Description:
11062  This function selects the bit order for checksum calculation.
11063  Precondition:
11064  None.
11065  Parameters:
11066  bitOrder - Specifies the bit order for CRC calculation
11067  Returns:
11068  None.
11069  Example:
11070  <code>
11071  PLIB_DMA_CRCBitOrderSelect ( DMA_ID_0,DMA_CRC_BIT_ORDER_LSB );
11072  </code>
11073  Remarks:
11074  This function implements an operation of the CRCBitOrder feature.
11075  This feature may not be available on all devices. Please refer to the
11076  specific device data sheet to determine availability or use the
11077  PLIB_DMA_ExistsCRCBitOrder function in your application to automatically
11078  determine whether this feature is available.
11079 */
11080 
11081 void
11083  DMA_MODULE_ID index ,
11084  DMA_CRC_BIT_ORDER bitOrder ) ;
11085 //******************************************************************************
11086 /* Function:
11087  void PLIB_DMA_CRCWriteByteOrderAlter ( DMA_MODULE_ID index )
11088  Summary:
11089  The source data is written to the destination reordered as defined by the
11090  BYTO<1:0> bits.
11091  Description:
11092  This function enables byte order alteration as specified by the BYTO<1:0> bits.
11093  The source data is written to the destination reordered as defined by the
11094  BYTO<1:0> bits.
11095  Precondition:
11096  None.
11097  Parameters:
11098  None.
11099  Returns:
11100  None.
11101  Example:
11102  <code>
11103  PLIB_DMA_CRCWriteByteOrderAlter ( DMA_ID_0 );
11104  </code>
11105  Remarks:
11106  This function implements an operation of the CRCWriteByteOrder feature.
11107  This feature may not be available on all devices. Please refer to the
11108  specific device data sheet to determine availability or use the
11109  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
11110  determine whether this feature is available.
11111 */
11112 
11113 void
11115  DMA_MODULE_ID index ) ;
11116 //******************************************************************************
11117 /* Function:
11118  void PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_MODULE_ID index )
11119  Summary:
11120  The source data is written to the destination unaltered.
11121  Description:
11122  This function disables byte order alteration. The source data is written
11123  to the destination unaltered.
11124  Precondition:
11125  None.
11126  Parameters:
11127  None.
11128  Returns:
11129  None.
11130  Example:
11131  <code>
11132  PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_ID_0 );
11133  </code>
11134  Remarks:
11135  This function implements an operation of the CRCWriteByteOrder feature.
11136  This feature may not be available on all devices. Please refer to the
11137  specific device data sheet to determine availability or use the
11138  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
11139  determine whether this feature is available.
11140 */
11141 
11142 void
11144  DMA_MODULE_ID index ) ;
11145 //******************************************************************************
11146 /* Function:
11147  void PLIB_DMA_CRCByteOrderSelect ( DMA_MODULE_ID index,
11148  DMA_CRC_BYTE_ORDER byteOrder )
11149  Summary:
11150  Selects the byte order.
11151  Description:
11152  This function selects the byte order.
11153  Precondition:
11154  The WBO bit must be set to use this function.
11155  Parameters:
11156  byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
11157  Returns:
11158  None.
11159  Example:
11160  <code>
11161  PLIB_DMA_CRCByteOrderSelect ( DMA_ID_0,
11162  DMA_CRC_SWAP_HALF_WORD_ON_WORD_BOUNDARY );
11163  </code>
11164  Remarks:
11165  This function implements an operation of the CRCByteOrder feature.
11166  This feature may not be available on all devices. Please refer to the
11167  specific device data sheet to determine availability or use the
11168  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
11169  determine whether this feature is available.
11170 */
11171 
11172 void
11174  DMA_MODULE_ID index ,
11175  DMA_CRC_BYTE_ORDER byteOrder ) ;
11176 //******************************************************************************
11177 /* Function:
11178  DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet ( DMA_MODULE_ID index )
11179  Summary:
11180  Gets the current byte order selected by the DMA module CRC feature.
11181  Description:
11182  This function gets the current byte order selected by the DMA module CRC feature.
11183  Precondition:
11184  The WBO bit must be set to use this function.
11185  Parameters:
11186  None.
11187  Returns:
11188  - byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
11189  Example:
11190  <code>
11191  DMA_CRC_BYTE_ORDER byteOrder;
11192  byteOrder = PLIB_DMA_CRCByteOrderGet ( DMA_ID_0 );
11193  </code>
11194  Remarks:
11195  This function implements an operation of the CRCByteOrder feature.
11196  This feature may not be available on all devices. Please refer to the
11197  specific device data sheet to determine availability or use the
11198  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
11199  determine whether this feature is available.
11200 */
11201 
11202 DMA_CRC_BYTE_ORDER
11204  DMA_MODULE_ID index ) ;
11205 //******************************************************************************
11206 /* Function:
11207  uint32_t PLIB_DMA_CRCDataRead ( DMA_MODULE_ID index )
11208  Summary:
11209  Reads the contents of the DMA CRC data register.
11210  Description:
11211  This function reads the contents of the DMA CRC data register.
11212  Precondition:
11213  None.
11214  Parameters:
11215  None.
11216  Returns:
11217  - uint32_t - 32-bit CRC data
11218  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
11219  device data sheet to determine availability.
11220  Example:
11221  <code>
11222  uint32_t DMACRCdata;
11223  DMACRCdata = PLIB_DMA_CRCDataRead ( DMA_ID_0 );
11224  </code>
11225  Remarks:
11226  This function implements an operation of the CRCData feature.
11227  This feature may not be available on all devices. Please refer to the
11228  specific device data sheet to determine availability or use the
11229  PLIB_DMA_ExistsCRCData function in your application to automatically
11230  determine whether this feature is available.
11231 */
11232 
11233 uint32_t
11235  DMA_MODULE_ID index ) ;
11236 //******************************************************************************
11237 /* Function:
11238  void PLIB_DMA_CRCDataWrite ( DMA_MODULE_ID index,
11239  uint32_t DMACRCdata )
11240  Summary:
11241  Writes the contents of the DMA CRC data register with the specified data.
11242  Description:
11243  This function writes the contents of the DMA CRC data register.
11244  Precondition:
11245  None.
11246  Parameters:
11247  - DMACRCdata - 32-bit CRC data
11248  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
11249  device data sheet to determine availability.
11250  Returns:
11251  None.
11252  Example:
11253  <code>
11254  uint32_t DMACRCdata = 0x0E0E0E;
11255  PLIB_DMA_CRCDataWrite ( DMA_ID_0, DMACRCdata );
11256  </code>
11257  Remarks:
11258  This function implements an operation of the CRCData feature.
11259  This feature may not be available on all devices. Please refer to the
11260  specific device data sheet to determine availability or use the
11261  PLIB_DMA_ExistsCRCData function in your application to automatically
11262  determine whether this feature is available.
11263 */
11264 
11265 void
11267  DMA_MODULE_ID index ,
11268  uint32_t DMACRCdata ) ;
11269 //******************************************************************************
11270 /* Function:
11271  uint32_t PLIB_DMA_CRCXOREnableGet ( DMA_MODULE_ID index )
11272  Summary:
11273  Reads the CRC XOR register.
11274  Description:
11275  This function reads the CRC XOR register.
11276  Precondition:
11277  None.
11278  Parameters:
11279  None.
11280  Returns:
11281  - uint32_t - 32-bit CRC XOR enable mask data
11282  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
11283  device data sheet to determine availability.
11284  Example:
11285  <code>
11286  uint32_t DMACRCXORdata;
11287  DMACRCXORdata = PLIB_DMA_CRCXOREnableGet ( DMA_ID_0 );
11288  </code>
11289  Remarks:
11290  This function implements an operation of the CRCXOREnable feature.
11291  This feature may not be available on all devices. Please refer to the
11292  specific device data sheet to determine availability or use the
11293  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
11294  determine whether this feature is available.
11295 */
11296 
11297 uint32_t
11299  DMA_MODULE_ID index ) ;
11300 //******************************************************************************
11301 /* Function:
11302  void PLIB_DMA_CRCXOREnableSet ( DMA_MODULE_ID index,
11303  uint32_t DMACRCXOREnableMask )
11304  Summary:
11305  Writes to the CRC XOR enable register as per the specified enable mask.
11306  Description:
11307  This function writes to the CRC XOR enable register as per the specified
11308  enable mask. Each enabled bit will be taken as input to the shift register.
11309  Precondition:
11310  None.
11311  Parameters:
11312  - DMACRCXOREnableMask - 32-bit CRC XOR enable mask data
11313  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
11314  device data sheet to determine availability.
11315  Returns:
11316  None.
11317  Example:
11318  <code>
11319  uint32_t DMACRCXOREnableMask = 0x05EFFFFF;
11320  PLIB_DMA_CRCXOREnableSet ( DMA_ID_0, DMACRCXOREnableMask );
11321  </code>
11322  Remarks:
11323  This function implements an operation of the CRCXOREnable feature.
11324  This feature may not be available on all devices. Please refer to the
11325  specific device data sheet to determine availability or use the
11326  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
11327  determine whether this feature is available.
11328 */
11329 
11330 void
11332  DMA_MODULE_ID index ,
11333  uint32_t DMACRCXOREnableMask ) ;
11334 // *****************************************************************************
11335 // *****************************************************************************
11336 // Section: DMA Address control Interface functions
11337 // *****************************************************************************
11338 // *****************************************************************************
11339 //******************************************************************************
11340 /* Function:
11341  uint32_t PLIB_DMA_ChannelXSourceStartAddressGet ( DMA_MODULE_ID index,
11342  DMA_CHANNEL dmaChannel )
11343  Summary:
11344  Reads the source start address configured for the specified channel.
11345  Description:
11346  This function reads the source start address configured for the specified
11347  channel.
11348  Precondition:
11349  None.
11350  Parameters:
11351  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11352  Returns:
11353  - uint32_t - The source start address configured for this channel
11354  Example:
11355  <code>
11356  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11357  uint32_t SourceStartAddress;
11358  SourceStartAddress = PLIB_DMA_ChannelXSourceStartAddressGet(DMA_ID_0,
11359  spiDMAChannel );
11360  </code>
11361  Remarks:
11362  This function implements an operation of the ChannelXSourceStartAddress feature.
11363  This feature may not be available on all devices. Please refer to the
11364  specific device data sheet to determine availability or use the
11365  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11366  determine whether this feature is available.
11367 */
11368 
11369 uint32_t
11371  DMA_MODULE_ID index ,
11372  DMA_CHANNEL dmaChannel ) ;
11373 //******************************************************************************
11374 /* Function:
11375  void PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_MODULE_ID index,
11376  DMA_CHANNEL dmaChannel,
11377  uint32_t sourceStartAddress)
11378  Summary:
11379  Writes the specified source start address into the register
11380  corresponding to the specified channel.
11381  Description:
11382  This function writes the specified Source start address into the register
11383  corresponding to the specified channel.
11384  Precondition:
11385  None.
11386  Parameters:
11387  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11388  sourceStartAddress - The source start address
11389  Returns:
11390  None.
11391  Example:
11392  <code>
11393  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11394  uint32_t sourceStartAddress = 0x00FDEA00;
11395  PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_ID_0,
11396  spiDMAChannel,
11397  sourceStartAddress );
11398  </code>
11399  Remarks:
11400  This function implements an operation of the ChannelXSourceStartAddress feature.
11401  This feature may not be available on all devices. Please refer to the
11402  specific device data sheet to determine availability or use the
11403  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11404  determine whether this feature is available.
11405 */
11406 
11407 void
11409  DMA_MODULE_ID index ,
11410  DMA_CHANNEL dmaChannel ,
11411  uint32_t sourceStartAddress ) ;
11412 //******************************************************************************
11413 /* Function:
11414  uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet ( DMA_MODULE_ID index,
11415  DMA_CHANNEL dmaChannel )
11416  Summary:
11417  Reads the destination start address configured for the specified channel.
11418  Description:
11419  This function reads the destination start address configured for the specified
11420  channel.
11421  Precondition:
11422  None.
11423  Parameters:
11424  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11425  Returns:
11426  - uint32_t - The destination start address configured for this channel
11427  Example:
11428  <code>
11429  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11430  uint32_t DestinationStartAddress;
11431  DestinationStartAddress = PLIB_DMA_ChannelXDestinationStartAddressGet (
11432  DMA_ID_0,
11433  spiDMAChannel );
11434  </code>
11435  Remarks:
11436  This function implements an operation of the ChannelXDestinationStartAddress feature.
11437  This feature may not be available on all devices. Please refer to the
11438  specific device data sheet to determine availability or use the
11439  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11440  determine whether this feature is available.
11441 */
11442 
11443 uint32_t
11445  DMA_MODULE_ID index ,
11446  DMA_CHANNEL dmaChannel ) ;
11447 //******************************************************************************
11448 /* Function:
11449  void PLIB_DMA_ChannelXDestinationStartAddressSet (
11450  DMA_MODULE_ID index,
11451  DMA_CHANNEL dmaChannel,
11452  uint32_t destinationStartAddress)
11453  Summary:
11454  Writes the specified destination start address into the register corresponding to
11455  the specified channel.
11456  Description:
11457  This function writes the specified destination start address into the register
11458  corresponding to the specified channel.
11459  Precondition:
11460  None.
11461  Parameters:
11462  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11463  destinationStartAddress - The destination start address
11464  Returns:
11465  None.
11466  Example:
11467  <code>
11468  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11469  uint32_t destinationStartAddress = 0x00FDEA00;
11470  PLIB_DMA_ChannelXDestinationStartAddressSet( DMA_ID_0,
11471  spiDMAChannel,
11472  destinationStartAddress );
11473  </code>
11474  Remarks:
11475  This function implements an operation of the ChannelXDestinationStartAddress feature.
11476  This feature may not be available on all devices. Please refer to the
11477  specific device data sheet to determine availability or use the
11478  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11479  determine whether this feature is available.
11480 */
11481 
11482 void
11484  DMA_MODULE_ID index ,
11485  DMA_CHANNEL dmaChannel ,
11486  uint32_t destinationStartAddress ) ;
11487 // *****************************************************************************
11488 // *****************************************************************************
11489 // Section: DMA Data control Interface functions
11490 // *****************************************************************************
11491 // *****************************************************************************
11492 //******************************************************************************
11493 /* Function:
11494  uint16_t PLIB_DMA_ChannelXSourceSizeGet ( DMA_MODULE_ID index,
11495  DMA_CHANNEL dmaChannel )
11496  Summary:
11497  Reads the source size configured for the specified channel.
11498  Description:
11499  This function reads the source size configured for the specified
11500  channel.
11501  Precondition:
11502  None.
11503  Parameters:
11504  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11505  Returns:
11506  - uint16_t - The Source size configured (in bytes) for this channel.
11507  The source size (8-bit, 16-bit) is device-specific. Please refer to the specific
11508  device data sheet to determine availability.
11509  Example:
11510  <code>
11511  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11512  uint16_t sourceSize;
11513  sourceSize = PLIB_DMA_ChannelXSourceSizeGet ( DMA_ID_0,
11514  spiDMAChannel );
11515  </code>
11516  Remarks:
11517  This function implements an operation of the ChannelXSourceSize feature.
11518  This feature may not be available on all devices. Please refer to the
11519  specific device data sheet to determine availability or use the
11520  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11521  determine whether this feature is available.
11522 */
11523 
11524 uint16_t
11526  DMA_MODULE_ID index ,
11527  DMA_CHANNEL dmaChannel ) ;
11528 //******************************************************************************
11529 /* Function:
11530  void PLIB_DMA_ChannelXSourceSizeSet ( DMA_MODULE_ID index,
11531  DMA_CHANNEL dmaChannel,
11532  uint16_t sourceSize)
11533  Summary:
11534  Writes the specified source size into the register corresponding
11535  to the specified channel.
11536  Description:
11537  This function writes the specified source size into the register
11538  corresponding to the specified channel.
11539  Precondition:
11540  None.
11541  Parameters:
11542  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11543  sourceSize - The source size. The source size (8-bit, 16-bit) is
11544  device-specific. Please refer to the specific device data
11545  sheet to determine availability.
11546  Returns:
11547  None.
11548  Example:
11549  <code>
11550  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11551  uint16_t sourceSize = 0xA00;
11552  PLIB_DMA_ChannelXSourceSizeSet ( DMA_ID_0,
11553  spiDMAChannel,
11554  sourceSize );
11555  </code>
11556  Remarks:
11557  This function implements an operation of the ChannelXSourceSize feature.
11558  This feature may not be available on all devices. Please refer to the
11559  specific device data sheet to determine availability or use the
11560  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11561  determine whether this feature is available.
11562 */
11563 
11564 void
11566  DMA_MODULE_ID index ,
11567  DMA_CHANNEL dmaChannel ,
11568  uint16_t sourceSize ) ;
11569 //******************************************************************************
11570 /* Function:
11571  uint16_t PLIB_DMA_ChannelXDestinationSizeGet ( DMA_MODULE_ID index,
11572  DMA_CHANNEL dmaChannel )
11573  Summary:
11574  Reads the destination size configured for the specified channel.
11575  Description:
11576  This function reads the destination size configured for the specified
11577  channel.
11578  Precondition:
11579  None.
11580  Parameters:
11581  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11582  Returns:
11583  - uint16_t - The destination size configured (in bytes) for this channel.
11584  The destination size (8-bit, 16-bit) is device-specific. Please refer to the specific
11585  device data sheet to determine availability.
11586  Example:
11587  <code>
11588  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11589  uint16_t DestinationSize;
11590  DestinationSize = PLIB_DMA_ChannelXDestinationSizeGet ( DMA_ID_0,
11591  spiDMAChannel );
11592  </code>
11593  Remarks:
11594  This function implements an operation of the ChannelXDestinationSize feature.
11595  This feature may not be available on all devices. Please refer to the
11596  specific device data sheet to determine availability or use the
11597  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11598  determine whether this feature is available.
11599 */
11600 
11601 uint16_t
11603  DMA_MODULE_ID index ,
11604  DMA_CHANNEL dmaChannel ) ;
11605 //******************************************************************************
11606 /* Function:
11607  void PLIB_DMA_ChannelXDestinationSizeSet ( DMA_MODULE_ID index,
11608  DMA_CHANNEL dmaChannel,
11609  uint16_t destinationSize)
11610  Summary:
11611  Writes the specified destination size into the register corresponding
11612  to the specified channel.
11613  Description:
11614  This function writes the specified destination size into the register
11615  corresponding to the specified channel.
11616  Precondition:
11617  None.
11618  Parameters:
11619  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11620  destinationSize - The destination size. The destination size (8-bit, 16-bit)
11621  is device-specific. Please refer to the specific device
11622  data sheet to determine availability.)
11623  Returns:
11624  None.
11625  Example:
11626  <code>
11627  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11628  uint16_t destinationSize = 0xA00;
11629  PLIB_DMA_ChannelXDestinationSizeSet( DMA_ID_0, spiDMAChannel, destinationSize );
11630  </code>
11631  Remarks:
11632  This function implements an operation of the ChannelXDestinationSize feature.
11633  This feature may not be available on all devices. Please refer to the
11634  specific device data sheet to determine availability or use the
11635  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11636  determine whether this feature is available.
11637 */
11638 
11639 void
11641  DMA_MODULE_ID index ,
11642  DMA_CHANNEL dmaChannel ,
11643  uint16_t destinationSize ) ;
11644 //******************************************************************************
11645 /* Function:
11646  uint16_t PLIB_DMA_ChannelXSourcePointerGet ( DMA_MODULE_ID index,
11647  DMA_CHANNEL dmaChannel )
11648  Summary:
11649  Reads the current byte of the source being pointed to for the specified channel.
11650  Description:
11651  This function reads the current byte of the source being pointed to for the
11652  specified channel.
11653  Precondition:
11654  None.
11655  Parameters:
11656  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11657  Returns:
11658  - uint16_t - The source byte being pointed to for this channel.
11659  The source pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11660  device data sheet to determine availability.
11661  Example:
11662  <code>
11663  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11664  uint16_t sourcebyte;
11665  sourcebyte = PLIB_DMA_ChannelXSourcePointerGet ( DMA_ID_0, spiDMAChannel );
11666  </code>
11667  Remarks:
11668  This function implements an operation of the ChannelXSourcePointer feature.
11669  This feature may not be available on all devices. Please refer to the
11670  specific device data sheet to determine availability or use the
11671  PLIB_DMA_ExistsChannelXSourcePointer function in your application to automatically
11672  determine whether this feature is available.
11673 */
11674 
11675 uint16_t
11677  DMA_MODULE_ID index ,
11678  DMA_CHANNEL dmaChannel ) ;
11679 //******************************************************************************
11680 /* Function:
11681  uint16_t PLIB_DMA_ChannelXDestinationPointerGet ( DMA_MODULE_ID index,
11682  DMA_CHANNEL dmaChannel )
11683  Summary:
11684  Reads the current byte of the destination being pointed to for the specified channel.
11685  Description:
11686  This function reads the current byte of the destination being pointed to for the
11687  specified channel.
11688  Precondition:
11689  None.
11690  Parameters:
11691  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11692  Returns:
11693  - uint16_t - The destination byte being pointed to for this channel.
11694  The destination pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11695  device data sheet to determine availability.
11696  Example:
11697  <code>
11698  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11699  uint16_t destinationbyte;
11700  destinationbyte = PLIB_DMA_ChannelXDestinationPointerGet ( DMA_ID_0,
11701  spiDMAChannel );
11702  </code>
11703  Remarks:
11704  This function implements an operation of the ChannelXDestinationPointer feature.
11705  This feature may not be available on all devices. Please refer to the
11706  specific device data sheet to determine availability or use the
11707  PLIB_DMA_ExistsChannelXDestinationPointer function in your application to automatically
11708  determine whether this feature is available.
11709 */
11710 
11711 uint16_t
11713  DMA_MODULE_ID index ,
11714  DMA_CHANNEL dmaChannel ) ;
11715 //******************************************************************************
11716 /* Function:
11717  uint16_t PLIB_DMA_ChannelXCellSizeGet ( DMA_MODULE_ID index,
11718  DMA_CHANNEL dmaChannel )
11719  Summary:
11720  Reads the cell size (in bytes) configured for the specified channel.
11721  Description:
11722  This function reads the cell size (in bytes) configured for the specified
11723  channel.
11724  Precondition:
11725  None.
11726  Parameters:
11727  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11728  Returns:
11729  - uint16_t - The cell size configured (in bytes) for this channel
11730  The cell size (8-bit, 16-bit) is device-specific. Please refer to the specific
11731  device data sheet to determine availability.
11732  Example:
11733  <code>
11734  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11735  uint16_t cellSize;
11736  cellSize = PLIB_DMA_ChannelXCellSizeGet ( DMA_ID_0,
11737  spiDMAChannel );
11738  </code>
11739  Remarks:
11740  This function implements an operation of the ChannelXCellSize feature.
11741  This feature may not be available on all devices. Please refer to the
11742  specific device data sheet to determine availability or use the
11743  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11744  determine whether this feature is available.
11745 */
11746 
11747 uint16_t
11749  DMA_MODULE_ID index ,
11750  DMA_CHANNEL dmaChannel ) ;
11751 //******************************************************************************
11752 /* Function:
11753  void PLIB_DMA_ChannelXCellSizeSet ( DMA_MODULE_ID index,
11754  DMA_CHANNEL dmaChannel,
11755  uint16_t cellSize)
11756  Summary:
11757  Writes the specified cell size into the register corresponding
11758  to the specified channel.
11759  Description:
11760  This function writes the specified cell size into the register
11761  corresponding to the specified channel.
11762  Precondition:
11763  None.
11764  Parameters:
11765  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11766  cellSize - The cell size in bytes. The cell size (8-bit, 16-bit) is
11767  device-specific. Please refer to the specific device data
11768  sheet to determine availability.)
11769  Returns:
11770  None.
11771  Example:
11772  <code>
11773  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11774  uint16_t cellSize = 0x10;
11775  PLIB_DMA_ChannelXCellSizeSet ( DMA_ID_0, spiDMAChannel, cellSize );
11776  </code>
11777  Remarks:
11778  This function implements an operation of the ChannelXCellSize feature.
11779  This feature may not be available on all devices. Please refer to the
11780  specific device data sheet to determine availability or use the
11781  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11782  determine whether this feature is available.
11783 */
11784 
11785 void
11787  DMA_MODULE_ID index ,
11788  DMA_CHANNEL dmaChannel ,
11789  uint16_t CellSize ) ;
11790 //******************************************************************************
11791 /* Function:
11792  uint16_t PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_MODULE_ID index,
11793  DMA_CHANNEL dmaChannel )
11794  Summary:
11795  Returns the number of bytes transferred since the last event.
11796  Description:
11797  This function returns the number of bytes transferred since the last event.
11798  Precondition:
11799  None.
11800  Parameters:
11801  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11802  Returns:
11803  - uint16_t - The number of bytes transferred since the last event.
11804  The cell progress pointer (8-bit, 16-bit) is device-specific. Please refer to
11805  the specific device data sheet to determine availability.
11806  Example:
11807  <code>
11808  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11809  uint16_t CellProgress;
11810  CellProgress = PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_ID_0,
11811  spiDMAChannel );
11812  </code>
11813  Remarks:
11814  This function implements an operation of the ChannelXCellProgressPointer feature.
11815  This feature may not be available on all devices. Please refer to the
11816  specific device data sheet to determine availability or use the
11817  PLIB_DMA_ExistsChannelXCellProgressPointer function in your application to automatically
11818  determine whether this feature is available.
11819 */
11820 
11821 uint16_t
11823  DMA_MODULE_ID index ,
11824  DMA_CHANNEL dmaChannel ) ;
11825 //******************************************************************************
11826 /* Function:
11827  uint16_t PLIB_DMA_ChannelXPatternDataGet ( DMA_MODULE_ID index,
11828  DMA_CHANNEL dmaChannel )
11829  Summary:
11830  Returns the pattern matching (for DMA abort) data programmed for the specified
11831  channel.
11832  Description:
11833  This function returns pattern matching (for DMA abort) data programmed for
11834  the specified channel.
11835  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11836  the specific device data sheet to determine availability.)
11837  Precondition:
11838  None.
11839  Parameters:
11840  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11841  Returns:
11842  - uint16_t - The pattern matching data programmed for the current channel.
11843  The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11844  the specific device data sheet to determine availability.
11845  Example:
11846  <code>
11847  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11848  uint16_t patternData;
11849  patternData = PLIB_DMA_ChannelXPatternDataGet ( DMA_ID_0, spiDMAChannel );
11850  </code>
11851  Remarks:
11852  This function implements an operation of the ChannelXPatternData feature.
11853  This feature may not be available on all devices. Please refer to the
11854  specific device data sheet to determine availability or use the
11855  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11856  determine whether this feature is available.
11857 */
11858 
11859 uint16_t
11861  DMA_MODULE_ID index ,
11862  DMA_CHANNEL dmaChannel ) ;
11863 //******************************************************************************
11864 /* Function:
11865  void PLIB_DMA_ChannelXPatternDataSet ( DMA_MODULE_ID index,
11866  DMA_CHANNEL dmaChannel,
11867  uint16_t patternData)
11868  Summary:
11869  Writes the specified pattern matching data (for DMA abort) into the register
11870  corresponding to the specified channel.
11871  Description:
11872  This function writes the specified pattern matching data (for DMA abort) into the
11873  register corresponding to the specified channel.
11874  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11875  the specific device data sheet to determine availability.)
11876  Precondition:
11877  None.
11878  Parameters:
11879  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11880  patternData - The pattern matching DATA programmed for the current channel
11881  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11882  the specific device data sheet to determine availability.)
11883  Returns:
11884  None.
11885  Example:
11886  <code>
11887  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11888  uint16_t patternData = '\0';
11889  PLIB_DMA_ChannelXPatternDataSet ( DMA_ID_0, spiDMAChannel, patternData );
11890  </code>
11891  Remarks:
11892  This function implements an operation of the ChannelXPatternData feature.
11893  This feature may not be available on all devices. Please refer to the
11894  specific device data sheet to determine availability or use the
11895  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11896  determine whether this feature is available.
11897 */
11898 
11899 void
11901  DMA_MODULE_ID index ,
11902  DMA_CHANNEL dmaChannel ,
11903  uint16_t patternData ) ;
11904 // *****************************************************************************
11905 // *****************************************************************************
11906 // Section: DMA Interrupt Control Interface functions
11907 // *****************************************************************************
11908 // *****************************************************************************
11909 //******************************************************************************
11910 /* Function:
11911  bool PLIB_DMA_ChannelXINTSourceFlagGet ( DMA_MODULE_ID index,
11912  DMA_CHANNEL dmaChannel,
11913  DMA_INT_TYPE dmaINTSource )
11914  Summary:
11915  Returns the status of the interrupt flag of the specified DMA interrupt source
11916  for the specified channel.
11917  Description:
11918  This function returns the status of the interrupt flag of the specified DMA interrupt
11919  source for the specified channel.
11920  Precondition:
11921  None.
11922  Parameters:
11923  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11924  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11925  Returns:
11926  - true - The interrupt flag is set
11927  - false - The interrupt flag is not set
11928  Example:
11929  <code>
11930  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11931  bool AddressErrorINTStatus;
11932  AddressErrorINTStatus = PLIB_DMA_ChannelXINTSourceFlagGet (
11933  DMA_ID_0,
11934  spiDMAChannel,
11935  DMA_INT_ADDRESS_ERROR );
11936  </code>
11937  Remarks:
11938  This function implements an operation of the ChannelXINTSourceFlag feature.
11939  This feature may not be available on all devices. Please refer to the
11940  specific device data sheet to determine availability or use the
11941  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11942  determine whether this feature is available.
11943 */
11944 
11945 bool
11947  DMA_MODULE_ID index ,
11948  DMA_CHANNEL dmaChannel ,
11949  DMA_INT_TYPE dmaINTSource ) ;
11950 //******************************************************************************
11951 /* Function:
11952  void PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_MODULE_ID index,
11953  DMA_CHANNEL dmaChannel,
11954  DMA_INT_TYPE dmaINTSource )
11955  Summary:
11956  Sets the interrupt flag of the specified DMA interrupt source for the specified channel.
11957  Description:
11958  This function sets the interrupt flag of the specified DMA interrupt source for
11959  the specified channel.
11960  Precondition:
11961  None.
11962  Parameters:
11963  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11964  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11965  Returns:
11966  None.
11967  Example:
11968  <code>
11969  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11970  PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_ID_0,
11971  spiDMAChannel,
11972  DMA_INT_ADDRESS_ERROR );
11973  </code>
11974  Remarks:
11975  This function implements an operation of the ChannelXINTSourceFlag feature.
11976  This feature may not be available on all devices. Please refer to the
11977  specific device data sheet to determine availability or use the
11978  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11979  determine whether this feature is available.
11980 */
11981 
11982 void
11984  DMA_MODULE_ID index ,
11985  DMA_CHANNEL dmaChannel ,
11986  DMA_INT_TYPE dmaINTSource ) ;
11987 //******************************************************************************
11988 /* Function:
11989  void PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_MODULE_ID index,
11990  DMA_CHANNEL dmaChannel,
11991  DMA_INT_TYPE dmaINTSource )
11992  Summary:
11993  Clears the interrupt flag of the specified DMA interrupt source
11994  for the specified channel.
11995  Description:
11996  This function clears the interrupt flag of the specified DMA interrupt source
11997  for the specified channel.
11998  Precondition:
11999  None.
12000  Parameters:
12001  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12002  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
12003  Returns:
12004  None.
12005  Example:
12006  <code>
12007  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12008  PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_ID_0,
12009  spiDMAChannel,
12010  DMA_INT_ADDRESS_ERROR );
12011  </code>
12012  Remarks:
12013  This function implements an operation of the ChannelXINTSourceFlag feature.
12014  This feature may not be available on all devices. Please refer to the
12015  specific device data sheet to determine availability or use the
12016  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
12017  determine whether this feature is available.
12018 */
12019 
12020 void
12022  DMA_MODULE_ID index ,
12023  DMA_CHANNEL dmaChannel ,
12024  DMA_INT_TYPE dmaINTSource ) ;
12025 //******************************************************************************
12026 /* Function:
12027  void PLIB_DMA_ChannelXINTSourceEnable ( DMA_MODULE_ID index,
12028  DMA_CHANNEL dmaChannel,
12029  DMA_INT_TYPE dmaINTSource )
12030  Summary:
12031  Enables the specified interrupt source for the specified channel.
12032  Description:
12033  This function enables the specified interrupt source for the specified channel.
12034  Precondition:
12035  None.
12036  Parameters:
12037  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12038  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
12039  Returns:
12040  None.
12041  Example:
12042  <code>
12043  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12044  PLIB_DMA_ChannelXINTSourceEnable ( DMA_ID_0,
12045  spiDMAChannel,
12046  DMA_INT_ADDRESS_ERROR );
12047  </code>
12048  Remarks:
12049  This function implements an operation of the ChannelXINTSource feature.
12050  This feature may not be available on all devices. Please refer to the
12051  specific device data sheet to determine availability or use the
12052  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
12053  determine whether this feature is available.
12054 */
12055 
12056 void
12058  DMA_MODULE_ID index ,
12059  DMA_CHANNEL dmaChannel ,
12060  DMA_INT_TYPE dmaINTSource ) ;
12061 //******************************************************************************
12062 /* Function:
12063  void PLIB_DMA_ChannelXINTSourceDisable ( DMA_MODULE_ID index,
12064  DMA_CHANNEL dmaChannel,
12065  DMA_INT_TYPE dmaINTSource )
12066  Summary:
12067  Disables the specified interrupt source for the specified channel.
12068  Description:
12069  This function disables the specified interrupt source for the specified channel.
12070  Precondition:
12071  None.
12072  Parameters:
12073  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12074  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
12075  Returns:
12076  None.
12077  Example:
12078  <code>
12079  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12080  PLIB_DMA_ChannelXINTSourceDisable ( DMA_ID_0,
12081  spiDMAChannel,
12082  DMA_INT_ADDRESS_ERROR );
12083  </code>
12084  Remarks:
12085  This function implements an operation of the ChannelXINTSource feature.
12086  This feature may not be available on all devices. Please refer to the
12087  specific device data sheet to determine availability or use the
12088  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
12089  determine whether this feature is available.
12090 */
12091 
12092 void
12094  DMA_MODULE_ID index ,
12095  DMA_CHANNEL dmaChannel ,
12096  DMA_INT_TYPE dmaINTSource ) ;
12097 //******************************************************************************
12098 /* Function:
12099  bool PLIB_DMA_ChannelXINTSourceIsEnabled ( DMA_MODULE_ID index,
12100  DMA_CHANNEL dmaChannel,
12101  DMA_INT_TYPE dmaINTSource )
12102  Summary:
12103  Returns the enable status of the specified interrupt source for the specified channel.
12104  Description:
12105  This function returns the enable status of the specified interrupt source for the
12106  specified channel.
12107  Precondition:
12108  None.
12109  Parameters:
12110  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12111  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
12112  Returns:
12113  - true - The interrupt is enabled
12114  - false - The interrupt is not enabled
12115  Example:
12116  <code>
12117  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
12118  bool dmaINTSourceEnableStatus;
12119  dmaINTSourceEnableStatus = PLIB_DMA_ChannelXINTSourceIsEnabled (
12120  DMA_ID_0,
12121  spiDMAChannel,
12122  DMA_INT_ADDRESS_ERROR );
12123  </code>
12124  Remarks:
12125  This function implements an operation of the ChannelXINTSource feature.
12126  This feature may not be available on all devices. Please refer to the
12127  specific device data sheet to determine availability or use the
12128  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
12129  determine whether this feature is available.
12130 */
12131 
12132 bool
12134  DMA_MODULE_ID index ,
12135  DMA_CHANNEL dmaChannel ,
12136  DMA_INT_TYPE dmaINTSource ) ;
12137 //******************************************************************************
12138 /* Function:
12139  void PLIB_DMA_ChannelXPatternLengthSet( DMA_MODULE_ID index,
12140  DMA_CHANNEL dmaChannel,DMA_PATTERN_LENGTH patternLen )
12141  Summary:
12142  Sets the pattern match length.
12143  Description:
12144  This function sets the length of the pattern match ignore to 1 or 2 bytes.
12145  Precondition:
12146  None.
12147  Parameters:
12148  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12149  patternLen - Length of pattern match (either 1 or 2)
12150  Returns:
12151  None.
12152  Example:
12153  <code>
12154  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12155  DMA_PATTERN_LENGTH patternLen;
12156  patternLen = DMA_PATTERN_MATCH_LENGTH_1BYTE;
12157  PLIB_DMA_ChannelXPatternLengthSet(DMA_ID_0, dmaChannel, patternLen);
12158  </code>
12159  Remarks:
12160  This function implements an operation of the ChannelXPatternLength feature.
12161  This feature may not be available on all devices. Please refer to the
12162  specific device data sheet to determine availability or use the
12163  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
12164  determine whether this feature is available.
12165 */
12166 
12167 void
12169  DMA_MODULE_ID index ,
12170  DMA_CHANNEL dmaChannel ,
12171  DMA_PATTERN_LENGTH patternLen ) ;
12172 //******************************************************************************
12173 /* Function:
12174  DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet( DMA_MODULE_ID index,
12175  DMA_CHANNEL dmaChannel);
12176  Summary:
12177  Returns the pattern match length.
12178  Description:
12179  This function returns the length of the byte matching the CHPIGN bits during a
12180  pattern match that may be ignored during the pattern match determination when
12181  the CHPIGNEN bit is set.
12182  Precondition:
12183  None.
12184  Parameters:
12185  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12186  Returns:
12187  - patternLen - Length of pattern match (either 1 or 2)
12188  Example:
12189  <code>
12190  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12191  DMA_PATTERN_LENGTH patternLen;
12192  patternLen = PLIB_DMA_ChannelXPatternLengthGet(DMA_ID_0, dmaChannel);
12193  </code>
12194  Remarks:
12195  This function implements an operation of the ChannelXPatternLength feature.
12196  This feature may not be available on all devices. Please refer to the
12197  specific device data sheet to determine availability or use the
12198  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
12199  determine whether this feature is available.
12200 */
12201 
12202 DMA_PATTERN_LENGTH
12204  DMA_MODULE_ID index ,
12205  DMA_CHANNEL dmaChannel ) ;
12206 //******************************************************************************
12207 /* Function:
12208  void PLIB_DMA_ChannelXPatternIgnoreByteEnable ( DMA_MODULE_ID index,
12209  DMA_CHANNEL channel );
12210  Summary:
12211  Enables the pattern match ignore byte.
12212  Description:
12213  This function enables the pattern match ignore byte.
12214  Precondition:
12215  None.
12216  Parameters:
12217  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12218  Returns:
12219  None.
12220  Example:
12221  <code>
12222  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12223  PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_ID_0, dmaChannel);
12224  </code>
12225  Remarks:
12226  This function implements an operation of the ChannelXPatternIgnoreByte feature.
12227  This feature may not be available on all devices. Please refer to the
12228  specific device data sheet to determine availability or use the
12229  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
12230  determine whether this feature is available.
12231 */
12232 
12233 void
12235  DMA_MODULE_ID index ,
12236  DMA_CHANNEL channel ) ;
12237 //******************************************************************************
12238 /* Function:
12239  bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled ( DMA_MODULE_ID index,
12240  DMA_CHANNEL channel );
12241  Summary:
12242  Returns the state of the pattern match ignore byte.
12243  Description:
12244  This function returns the state (enabled or disabled) of the pattern match
12245  ignore byte.
12246  Precondition:
12247  None.
12248  Parameters:
12249  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12250  Returns:
12251  - true - The pattern match ignore byte is enabled
12252  - false - The pattern match ignore byte is disabled
12253  Example:
12254  <code>
12255  bool patternIsEnabled;
12256  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12257  patternIsEnabled = PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_ID_0, dmaChannel);
12258  </code>
12259  Remarks:
12260  This function implements an operation of the ChannelXPatternIgnoreByte feature.
12261  This feature may not be available on all devices. Please refer to the
12262  specific device data sheet to determine availability or use the
12263  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
12264  determine whether this feature is available.
12265 */
12266 
12267 bool
12269  DMA_MODULE_ID index ,
12270  DMA_CHANNEL channel ) ;
12271 //******************************************************************************
12272 /* Function:
12273  void PLIB_DMA_ChannelXPatternIgnoreByteDisable ( DMA_MODULE_ID index,
12274  DMA_CHANNEL channel );
12275  Summary:
12276  Disables the pattern match ignore byte.
12277  Description:
12278  This function disables the pattern match ignore byte.
12279  Precondition:
12280  None.
12281  Parameters:
12282  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12283  Returns:
12284  None.
12285  Example:
12286  <code>
12287  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12288  PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_ID_0, dmaChannel);
12289  </code>
12290  Remarks:
12291  This function implements an operation of the ChannelXPatternIgnoreByte feature.
12292  This feature may not be available on all devices. Please refer to the
12293  specific device data sheet to determine availability or use the
12294  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
12295  determine whether this feature is available.
12296 */
12297 
12298 void
12300  DMA_MODULE_ID index ,
12301  DMA_CHANNEL channel ) ;
12302 //******************************************************************************
12303 /* Function:
12304  void PLIB_DMA_ChannelXPatternIgnoreSet (DMA_MODULE_ID index,
12305  DMA_CHANNEL channel, uint8_t pattern );
12306  Summary:
12307  Sets the pattern match ignore value.
12308  Description:
12309  This function sets the value of the pattern match ignore.
12310  Precondition:
12311  None.
12312  Parameters:
12313  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12314  pattern - Pattern match ignore value
12315  Returns:
12316  None.
12317  Example:
12318  <code>
12319  uint8_t patternMatch = 0x8;
12320  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12321  PLIB_DMA_ChannelXPatternIgnoreSet ( DMA_ID_0, dmaChannel,patternMatch);
12322  </code>
12323  Remarks:
12324  This function implements an operation of the ChannelXPatternIgnore feature.
12325  This feature may not be available on all devices. Please refer to the
12326  specific device data sheet to determine availability or use the
12327  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
12328  determine whether this feature is available.
12329 */
12330 
12331 void
12333  DMA_MODULE_ID index ,
12334  DMA_CHANNEL channel ,
12335  uint8_t pattern ) ;
12336 //******************************************************************************
12337 /* Function:
12338  uint8_t PLIB_DMA_ChannelXPatternIgnoreGet( DMA_MODULE_ID index,
12339  DMA_CHANNEL channel );
12340  Summary:
12341  Returns the pattern match ignore value.
12342  Description:
12343  This function returns the value of the pattern match ignore.
12344  Precondition:
12345  None.
12346  Parameters:
12347  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12348  Returns:
12349  - uint8_t - Pattern match ignore value
12350  Example:
12351  <code>
12352  uint8_t patternMatch;
12353  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12354  patternMatch = PLIB_DMA_ChannelXPatternIgnoreGet ( DMA_ID_0, dmaChannel);
12355  </code>
12356  Remarks:
12357  This function implements an operation of the ChannelXPatternIgnore feature.
12358  This feature may not be available on all devices. Please refer to the
12359  specific device data sheet to determine availability or use the
12360  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
12361  determine whether this feature is available.
12362 */
12363 
12364 uint8_t
12366  DMA_MODULE_ID index ,
12367  DMA_CHANNEL channel ) ;
12368 // *****************************************************************************
12369 // *****************************************************************************
12370 // Section: DMA Peripheral Library Exists API Routines
12371 // *****************************************************************************
12372 // *****************************************************************************
12373 /* The following functions indicate the existence of the features on the device.
12374 */
12375 //******************************************************************************
12376 /* Function : PLIB_DMA_ExistsBusy( DMA_MODULE_ID index )
12377  Summary:
12378  Identifies whether the Busy feature exists on the DMA module.
12379  Description:
12380  This function identifies whether the Busy feature is available on the
12381  DMA module.
12382  When this function returns true, these functions are supported on the device:
12383  - PLIB_DMA_BusyActiveSet
12384  - PLIB_DMA_BusyActiveReset
12385  - PLIB_DMA_IsBusy
12386  Preconditions:
12387  None.
12388  Parameters:
12389  index - Identifier for the device instance
12390  Returns:
12391  - true - The Busy feature is supported on the device
12392  - false - The Busy feature is not supported on the device
12393  Remarks:
12394  None.
12395 */
12396 
12397 bool
12399  DMA_MODULE_ID index ) ;
12400 //******************************************************************************
12401 /* Function : PLIB_DMA_ExistsSuspend( DMA_MODULE_ID index )
12402  Summary:
12403  Identifies whether the Suspend feature exists on the DMA module.
12404  Description:
12405  This function identifies whether the Suspend feature is available on the
12406  DMA module.
12407  When this function returns true, these functions are supported on the device:
12408  - PLIB_DMA_SuspendEnable
12409  - PLIB_DMA_SuspendDisable
12410  - PLIB_DMA_SuspendIsEnabled
12411  Preconditions:
12412  None.
12413  Parameters:
12414  index - Identifier for the device instance
12415  Returns:
12416  - true - The Suspend feature is supported on the device
12417  - false - The Suspend feature is not supported on the device
12418  Remarks:
12419  None.
12420 */
12421 
12422 bool
12424  DMA_MODULE_ID index ) ;
12425 //******************************************************************************
12426 /* Function : PLIB_DMA_ExistsStopInIdle( DMA_MODULE_ID index )
12427  Summary:
12428  Identifies whether the StopInIdle feature exists on the DMA module.
12429  Description:
12430  This function identifies whether the StopInIdle feature is available on the
12431  DMA module.
12432  When this function returns true, these functions are supported on the device:
12433  - PLIB_DMA_StopInIdleEnable
12434  - PLIB_DMA_StopInIdleDisable
12435  Preconditions:
12436  None.
12437  Parameters:
12438  index - Identifier for the device instance
12439  Returns:
12440  - true - The StopInIdle feature is supported on the device
12441  - false - The StopInIdle feature is not supported on the device
12442  Remarks:
12443  None.
12444 */
12445 
12446 bool
12448  DMA_MODULE_ID index ) ;
12449 //******************************************************************************
12450 /* Function : PLIB_DMA_ExistsEnableControl( DMA_MODULE_ID index )
12451  Summary:
12452  Identifies whether the EnableControl feature exists on the DMA module.
12453  Description:
12454  This function identifies whether the EnableControl feature is available on
12455  the DMA module.
12456  When this function returns true, these functions are supported on the device:
12457  - PLIB_DMA_Enable
12458  - PLIB_DMA_Disable
12459  - PLIB_DMA_IsEnabled
12460  Preconditions:
12461  None.
12462  Parameters:
12463  index - Identifier for the device instance
12464  Returns:
12465  - true - The EnableControl feature is supported on the device
12466  - false - The EnableControl feature is not supported on the device
12467  Remarks:
12468  None.
12469 */
12470 
12471 bool
12473  DMA_MODULE_ID index ) ;
12474 //******************************************************************************
12475 /* Function : PLIB_DMA_ExistsChannelBits( DMA_MODULE_ID index )
12476  Summary:
12477  Identifies whether the ChannelBits feature exists on the DMA module.
12478  Description:
12479  This function identifies whether the ChannelBits feature is available on the
12480  DMA module.
12481  When this function returns true, this function is supported on the device:
12482  - PLIB_DMA_ChannelBitsGet
12483  Preconditions:
12484  None.
12485  Parameters:
12486  index - Identifier for the device instance
12487  Returns:
12488  - true - The ChannelBits feature is supported on the device
12489  - false - The ChannelBits feature is not supported on the device
12490  Remarks:
12491  None.
12492 */
12493 
12494 bool
12496  DMA_MODULE_ID index ) ;
12497 //******************************************************************************
12498 /* Function : PLIB_DMA_ExistsLastBusAccess( DMA_MODULE_ID index )
12499  Summary:
12500  Identifies whether the LastBusAccess feature exists on the DMA module.
12501  Description:
12502  This function identifies whether the LastBusAccess feature is available on the
12503  DMA module.
12504  When this function returns true, these functions are supported on the device:
12505  - PLIB_DMA_LastBusAccessIsRead
12506  - PLIB_DMA_LastBusAccessIsWrite
12507  Preconditions:
12508  None.
12509  Parameters:
12510  index - Identifier for the device instance
12511  Returns:
12512  - true - The LastBusAccess feature is supported on the device
12513  - false - The LastBusAccess feature is not supported on the device
12514  Remarks:
12515  None.
12516 */
12517 
12518 bool
12520  DMA_MODULE_ID index ) ;
12521 //******************************************************************************
12522 /* Function : PLIB_DMA_ExistsRecentAddress( DMA_MODULE_ID index )
12523  Summary:
12524  Identifies whether the RecentAddress feature exists on the DMA module.
12525  Description:
12526  This function identifies whether the RecentAddress feature is available on
12527  the DMA module.
12528  When this function returns true, this function is supported on the device:
12529  - PLIB_DMA_RecentAddressAccessed
12530  Preconditions:
12531  None.
12532  Parameters:
12533  index - Identifier for the device instance
12534  Returns:
12535  - true - The RecentAddress feature is supported on the device
12536  - false - The RecentAddress feature is not supported on the device
12537  Remarks:
12538  None.
12539 */
12540 
12541 bool
12543  DMA_MODULE_ID index ) ;
12544 //******************************************************************************
12545 /* Function : PLIB_DMA_ExistsCRCChannel( DMA_MODULE_ID index )
12546  Summary:
12547  Identifies whether the CRCChannel feature exists on the DMA module.
12548  Description:
12549  This function identifies whether the CRCChannel feature is available on the
12550  DMA module.
12551  When this function returns true, these functions are supported on the device:
12552  - PLIB_DMA_CRCChannelSelect
12553  - PLIB_DMA_CRCChannelGet
12554  Preconditions:
12555  None.
12556  Parameters:
12557  index - Identifier for the device instance
12558  Returns:
12559  - true - The CRCChannel feature is supported on the device
12560  - false - The CRCChannel feature is not supported on the device
12561  Remarks:
12562  None.
12563 */
12564 
12565 bool
12567  DMA_MODULE_ID index ) ;
12568 //******************************************************************************
12569 /* Function : PLIB_DMA_ExistsCRCType( DMA_MODULE_ID index )
12570  Summary:
12571  Identifies whether the CRCType feature exists on the DMA module.
12572  Description:
12573  This function identifies whether the CRCType feature is available on the
12574  DMA module.
12575  When this function returns true, these functions are supported on the device:
12576  - PLIB_DMA_CRCTypeGet
12577  - PLIB_DMA_CRCTypeSet
12578  Preconditions:
12579  None.
12580  Parameters:
12581  index - Identifier for the device instance
12582  Returns:
12583  - true - The CRCType feature is supported on the device
12584  - false - The CRCType feature is not supported on the device
12585  Remarks:
12586  None.
12587 */
12588 
12589 bool
12591  DMA_MODULE_ID index ) ;
12592 //******************************************************************************
12593 /* Function : PLIB_DMA_ExistsCRCAppendMode( DMA_MODULE_ID index )
12594  Summary:
12595  Identifies whether the CRCAppendMode feature exists on the DMA module.
12596  Description:
12597  This function identifies whether the CRCAppendMode feature is available on
12598  the DMA module.
12599  When this function returns true, these functions are supported on the device:
12600  - PLIB_DMA_CRCAppendModeEnable
12601  - PLIB_DMA_CRCAppendModeDisable
12602  - PLIB_DMA_CRCAppendModeIsEnabled
12603  Preconditions:
12604  None.
12605  Parameters:
12606  index - Identifier for the device instance
12607  Returns:
12608  - true - The CRCAppendMode feature is supported on the device
12609  - false - The CRCAppendMode feature is not supported on the device
12610  Remarks:
12611  None.
12612 */
12613 
12614 bool
12616  DMA_MODULE_ID index ) ;
12617 //******************************************************************************
12618 /* Function : PLIB_DMA_ExistsCRC( DMA_MODULE_ID index )
12619  Summary:
12620  Identifies whether the CRC feature exists on the DMA module.
12621  Description:
12622  This function identifies whether the CRC feature is available on the DMA module.
12623  When this function returns true, these functions are supported on the device:
12624  - PLIB_DMA_CRCEnable
12625  - PLIB_DMA_CRCDisable
12626  - PLIB_DMA_CRCIsEnabled
12627  Preconditions:
12628  None.
12629  Parameters:
12630  index - Identifier for the device instance
12631  Returns:
12632  - true - The CRC feature is supported on the device
12633  - false - The CRC feature is not supported on the device
12634  Remarks:
12635  None.
12636 */
12637 
12638 bool
12640  DMA_MODULE_ID index ) ;
12641 //******************************************************************************
12642 /* Function : PLIB_DMA_ExistsCRCPolynomialLength( DMA_MODULE_ID index )
12643  Summary:
12644  Identifies whether the CRCPolynomialLength feature exists on the DMA module.
12645  Description:
12646  This function identifies whether the CRCPolynomialLength feature is available
12647  on the DMA module.
12648  When this function returns true, these functions are supported on the device:
12649  - PLIB_DMA_CRCPolynomialLengthSet
12650  - PLIB_DMA_CRCPolynomialLengthGet
12651  Preconditions:
12652  None.
12653  Parameters:
12654  index - Identifier for the device instance
12655  Returns:
12656  - true - The CRCPolynomialLength feature is supported on the device
12657  - false - The CRCPolynomialLength feature is not supported on the device
12658  Remarks:
12659  None.
12660 */
12661 
12662 bool
12664  DMA_MODULE_ID index ) ;
12665 //******************************************************************************
12666 /* Function : PLIB_DMA_ExistsCRCBitOrder( DMA_MODULE_ID index )
12667  Summary:
12668  Identifies whether the CRCBitOrder feature exists on the DMA module.
12669  Description:
12670  This function identifies whether the CRCBitOrder feature is available on the
12671  DMA module.
12672  When this function returns true, this function is supported on the device:
12673  - PLIB_DMA_CRCBitOrderSelect
12674  Preconditions:
12675  None.
12676  Parameters:
12677  index - Identifier for the device instance
12678  Returns:
12679  - true - The CRCBitOrder feature is supported on the device
12680  - false - The CRCBitOrder feature is not supported on the device
12681  Remarks:
12682  None.
12683 */
12684 
12685 bool
12687  DMA_MODULE_ID index ) ;
12688 //******************************************************************************
12689 /* Function : PLIB_DMA_ExistsCRCWriteByteOrder( DMA_MODULE_ID index )
12690  Summary:
12691  Identifies whether the CRCWriteByteOrder feature exists on the DMA module.
12692  Description:
12693  This function identifies whether the CRCWriteByteOrder feature is available
12694  on the DMA module.
12695  When this function returns true, these functions are supported on the device:
12696  - PLIB_DMA_CRCWriteByteOrderAlter
12697  - PLIB_DMA_CRCWriteByteOrderMaintain
12698  Preconditions:
12699  None.
12700  Parameters:
12701  index - Identifier for the device instance
12702  Returns:
12703  - true - The CRCWriteByteOrder feature is supported on the device
12704  - false - The CRCWriteByteOrder feature is not supported on the device
12705  Remarks:
12706  None.
12707 */
12708 
12709 bool
12711  DMA_MODULE_ID index ) ;
12712 //******************************************************************************
12713 /* Function : PLIB_DMA_ExistsCRCByteOrder( DMA_MODULE_ID index )
12714  Summary:
12715  Identifies whether the CRCByteOrder feature exists on the DMA module.
12716  Description:
12717  This function identifies whether the CRCByteOrder feature is available on
12718  the DMA module.
12719  When this function returns true, these functions are supported on the device:
12720  - PLIB_DMA_CRCByteOrderSelect
12721  - PLIB_DMA_CRCByteOrderGet
12722  Preconditions:
12723  None.
12724  Parameters:
12725  index - Identifier for the device instance
12726  Returns:
12727  - true - The CRCByteOrder feature is supported on the device
12728  - false - The CRCByteOrder feature is not supported on the device
12729  Remarks:
12730  None.
12731 */
12732 
12733 bool
12735  DMA_MODULE_ID index ) ;
12736 //******************************************************************************
12737 /* Function : PLIB_DMA_ExistsCRCData( DMA_MODULE_ID index )
12738  Summary:
12739  Identifies whether the CRCData feature exists on the DMA module.
12740  Description:
12741  This function identifies whether the CRCData feature is available on the
12742  DMA module.
12743  When this function returns true, these functions are supported on the device:
12744  - PLIB_DMA_CRCDataRead
12745  - PLIB_DMA_CRCDataWrite
12746  Preconditions:
12747  None.
12748  Parameters:
12749  index - Identifier for the device instance
12750  Returns:
12751  - true - The CRCData feature is supported on the device
12752  - false - The CRCData feature is not supported on the device
12753  Remarks:
12754  None.
12755 */
12756 
12757 bool
12759  DMA_MODULE_ID index ) ;
12760 //******************************************************************************
12761 /* Function : PLIB_DMA_ExistsCRCXOREnable( DMA_MODULE_ID index )
12762  Summary:
12763  Identifies whether the CRCXOREnable feature exists on the DMA module.
12764  Description:
12765  This function identifies whether the CRCXOREnable feature is available on the
12766  DMA module.
12767  When this function returns true, these functions are supported on the device:
12768  - PLIB_DMA_CRCXOREnableSet
12769  - PLIB_DMA_CRCXOREnableGet
12770  Preconditions:
12771  None.
12772  Parameters:
12773  index - Identifier for the device instance
12774  Returns:
12775  - true - The CRCXOREnable feature is supported on the device
12776  - false - The CRCXOREnable feature is not supported on the device
12777  Remarks:
12778  None.
12779 */
12780 
12781 bool
12783  DMA_MODULE_ID index ) ;
12784 //******************************************************************************
12785 /* Function : PLIB_DMA_ExistsChannelXPriority( DMA_MODULE_ID index )
12786  Summary:
12787  Identifies whether the ChannelXPriority feature exists on the DMA module.
12788  Description:
12789  This function identifies whether the ChannelXPriority feature is available on
12790  the DMA module.
12791  When this function returns true, these functions are supported on the device:
12792  - PLIB_DMA_ChannelXPrioritySelect
12793  - PLIB_DMA_ChannelXPriorityGet
12794  Preconditions:
12795  None.
12796  Parameters:
12797  index - Identifier for the device instance
12798  Returns:
12799  - true - The ChannelXPriority feature is supported on the device
12800  - false - The ChannelXPriority feature is not supported on the device
12801  Remarks:
12802  None.
12803 */
12804 
12805 bool
12807  DMA_MODULE_ID index ) ;
12808 //******************************************************************************
12809 /* Function : PLIB_DMA_ExistsChannelXEvent( DMA_MODULE_ID index )
12810  Summary:
12811  Identifies whether the ChannelXEvent feature exists on the DMA module.
12812  Description:
12813  This function identifies whether the ChannelXEvent feature is available on
12814  the DMA module.
12815  When this function returns true, this function is supported on the device:
12816  - PLIB_DMA_ChannelXEventIsDetected
12817  Preconditions:
12818  None.
12819  Parameters:
12820  index - Identifier for the device instance
12821  Returns:
12822  - true - The ChannelXEvent feature is supported on the device
12823  - false - The ChannelXEvent feature is not supported on the device
12824  Remarks:
12825  None.
12826 */
12827 
12828 bool
12830  DMA_MODULE_ID index ) ;
12831 //******************************************************************************
12832 /* Function : PLIB_DMA_ExistsChannelXAuto( DMA_MODULE_ID index )
12833  Summary:
12834  Identifies whether the ChannelXAuto feature exists on the DMA module.
12835  Description:
12836  This function identifies whether the ChannelXAuto feature is available on
12837  the DMA module.
12838  When this function returns true, these functions are supported on the device:
12839  - PLIB_DMA_ChannelXAutoEnable
12840  - PLIB_DMA_ChannelXAutoDisable
12841  - PLIB_DMA_ChannelXAutoIsEnabled
12842  Preconditions:
12843  None.
12844  Parameters:
12845  index - Identifier for the device instance
12846  Returns:
12847  - true - The ChannelXAuto feature is supported on the device
12848  - false - The ChannelXAuto feature is not supported on the device
12849  Remarks:
12850  None.
12851 */
12852 
12853 bool
12855  DMA_MODULE_ID index ) ;
12856 //******************************************************************************
12857 /* Function : PLIB_DMA_ExistsChannelXChainEnbl( DMA_MODULE_ID index )
12858  Summary:
12859  Identifies whether the ChannelXChainEnbl feature exists on the DMA module.
12860  Description:
12861  This function identifies whether the ChannelXChainEnbl feature is available
12862  on the DMA module.
12863  When this function returns true, these functions are supported on the device:
12864  - PLIB_DMA_ChannelXChainEnable
12865  - PLIB_DMA_ChannelXChainDisable
12866  - PLIB_DMA_ChannelXChainIsEnabled
12867  Preconditions:
12868  None.
12869  Parameters:
12870  index - Identifier for the device instance
12871  Returns:
12872  - true - The ChannelXChainEnbl feature is supported on the device
12873  - false - The ChannelXChainEnbl feature is not supported on the device
12874  Remarks:
12875  None.
12876 */
12877 
12878 bool
12880  DMA_MODULE_ID index ) ;
12881 //******************************************************************************
12882 /* Function : PLIB_DMA_ExistsChannelXDisabled( DMA_MODULE_ID index )
12883  Summary:
12884  Identifies whether the ChannelXDisabled feature exists on the DMA module.
12885  Description:
12886  This function identifies whether the ChannelXDisabled feature is available
12887  on the DMA module.
12888  When this function returns true, these functions are supported on the device:
12889  - PLIB_DMA_ChannelXDisabledEnablesEvents
12890  - PLIB_DMA_ChannelXDisabledDisablesEvents
12891  Preconditions:
12892  None.
12893  Parameters:
12894  index - Identifier for the device instance
12895  Returns:
12896  - true - The ChannelXDisabled feature is supported on the device
12897  - false - The ChannelXDisabled feature is not supported on the device
12898  Remarks:
12899  None.
12900 */
12901 
12902 bool
12904  DMA_MODULE_ID index ) ;
12905 //******************************************************************************
12906 /* Function : PLIB_DMA_ExistsChannelX( DMA_MODULE_ID index )
12907  Summary:
12908  Identifies whether the ChannelX feature exists on the DMA module.
12909  Description:
12910  This function identifies whether the ChannelX feature is available on the
12911  DMA module.
12912  When this function returns true, these functions are supported on the device:
12913  - PLIB_DMA_ChannelXEnable
12914  - PLIB_DMA_ChannelXIsEnabled
12915  - PLIB_DMA_ChannelXDisable
12916  Preconditions:
12917  None.
12918  Parameters:
12919  index - Identifier for the device instance
12920  Returns:
12921  - true - The ChannelX feature is supported on the device
12922  - false - The ChannelX feature is not supported on the device
12923  Remarks:
12924  None.
12925 */
12926 
12927 bool
12929  DMA_MODULE_ID index ) ;
12930 //******************************************************************************
12931 /* Function : PLIB_DMA_ExistsChannelXChain( DMA_MODULE_ID index )
12932  Summary:
12933  Identifies whether the ChannelXChain feature exists on the DMA module.
12934  Description:
12935  This function identifies whether the ChannelXChain feature is available on the
12936  DMA module.
12937  When this function returns true, these functions are supported on the device:
12938  - PLIB_DMA_ChannelXChainToLower
12939  - PLIB_DMA_ChannelXChainToHigher
12940  Preconditions:
12941  None.
12942  Parameters:
12943  index - Identifier for the device instance
12944  Returns:
12945  - true - The ChannelXChain feature is supported on the device
12946  - false - The ChannelXChain feature is not supported on the device
12947  Remarks:
12948  None.
12949 */
12950 
12951 bool
12953  DMA_MODULE_ID index ) ;
12954 //******************************************************************************
12955 /* Function : PLIB_DMA_ExistsChannelXPatternLength( DMA_MODULE_ID index )
12956  Summary:
12957  Identifies whether the ChannelXPatternLength feature exists on the DMA module.
12958  Description:
12959  This function identifies whether the ChannelXPatternLength feature is available
12960  on the DMA module.
12961  When this function returns true, these functions are supported on the device:
12962  - PLIB_DMA_ChannelXPatternLengthSet
12963  - PLIB_DMA_ChannelXPatternLengthGet
12964  Preconditions:
12965  None.
12966  Parameters:
12967  index - Identifier for the device instance
12968  Returns:
12969  - true - The ChannelXPatternLength feature is supported on the device
12970  - false - The ChannelXPatternLength feature is not supported on the device
12971  Remarks:
12972  None.
12973 */
12974 
12975 bool
12977  DMA_MODULE_ID index ) ;
12978 //******************************************************************************
12979 /* Function : PLIB_DMA_ExistsChannelXPatternIgnoreByte( DMA_MODULE_ID index )
12980  Summary:
12981  Identifies whether the ChannelXPatternIgnoreByte feature exists on the DMA
12982  module.
12983  Description:
12984  This function identifies whether the ChannelXPatternIgnoreByte feature is
12985  available on the DMA module.
12986  When this function returns true, these functions are supported on the device:
12987  - PLIB_DMA_ChannelXPatternIgnoreByteEnable
12988  - PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled
12989  - PLIB_DMA_ChannelXPatternIgnoreByteDisable
12990  Preconditions:
12991  None.
12992  Parameters:
12993  index - Identifier for the device instance
12994  Returns:
12995  - true - The ChannelXPatternIgnoreByte feature is supported on the device
12996  - false - The ChannelXPatternIgnoreByte feature is not supported on the device
12997  Remarks:
12998  None.
12999 */
13000 
13001 bool
13003  DMA_MODULE_ID index ) ;
13004 //******************************************************************************
13005 /* Function : PLIB_DMA_ExistsChannelXBusy( DMA_MODULE_ID index )
13006  Summary:
13007  Identifies whether the ChannelXBusy feature exists on the DMA module.
13008  Description:
13009  This function identifies whether the ChannelXBusy feature is available on the
13010  DMA module.
13011  When this function returns true, these functions are supported on the device:
13012  - PLIB_DMA_ChannelXBusyActiveSet
13013  - PLIB_DMA_ChannelXBusyInActiveSet
13014  - PLIB_DMA_ChannelXBusyIsBusy
13015  Preconditions:
13016  None.
13017  Parameters:
13018  index - Identifier for the device instance
13019  Returns:
13020  - true - The ChannelXBusy feature is supported on the device
13021  - false - The ChannelXBusy feature is not supported on the device
13022  Remarks:
13023  None.
13024 */
13025 
13026 bool
13028  DMA_MODULE_ID index ) ;
13029 //******************************************************************************
13030 /* Function : PLIB_DMA_ExistsChannelXPatternIgnore( DMA_MODULE_ID index )
13031  Summary:
13032  Identifies whether the ChannelXPatternIgnore feature exists on the DMA module.
13033  Description:
13034  This function identifies whether the ChannelXPatternIgnore feature is available
13035  on the DMA module.
13036  When this function returns true, these functions are supported on the device:
13037  - PLIB_DMA_ChannelXPatternIgnoreSet
13038  - PLIB_DMA_ChannelXPatternIgnoreGet
13039  Preconditions:
13040  None.
13041  Parameters:
13042  index - Identifier for the device instance
13043  Returns:
13044  - true - The ChannelXPatternIgnore feature is supported on the device
13045  - false - The ChannelXPatternIgnore feature is not supported on the device
13046  Remarks:
13047  None.
13048 */
13049 
13050 bool
13052  DMA_MODULE_ID index ) ;
13053 //******************************************************************************
13054 /* Function : PLIB_DMA_ExistsChannelXTrigger( DMA_MODULE_ID index )
13055  Summary:
13056  Identifies whether the ChannelXTrigger feature exists on the DMA module.
13057  Description:
13058  This function identifies whether the ChannelXTrigger feature is available on
13059  the DMA module.
13060  When this function returns true, these functions are supported on the device:
13061  - PLIB_DMA_ChannelXTriggerEnable
13062  - PLIB_DMA_ChannelXTriggerIsEnabled
13063  - PLIB_DMA_ChannelXTriggerDisable
13064  Preconditions:
13065  None.
13066  Parameters:
13067  index - Identifier for the device instance
13068  Returns:
13069  - true - The ChannelXTrigger feature is supported on the device
13070  - false - The ChannelXTrigger feature is not supported on the device
13071  Remarks:
13072  None.
13073 */
13074 
13075 bool
13077  DMA_MODULE_ID index ) ;
13078 //******************************************************************************
13079 /* Function : PLIB_DMA_ExistsAbortTransfer( DMA_MODULE_ID index )
13080  Summary:
13081  Identifies whether the AbortTransfer feature exists on the DMA module.
13082  Description:
13083  This function identifies whether the AbortTransfer feature is available on
13084  the DMA module.
13085  When this function returns true, this function is supported on the device:
13086  - PLIB_DMA_AbortTransferSet
13087  Preconditions:
13088  None.
13089  Parameters:
13090  index - Identifier for the device instance
13091  Returns:
13092  - true - The AbortTransfer feature is supported on the device
13093  - false - The AbortTransfer feature is not supported on the device
13094  Remarks:
13095  None.
13096 */
13097 
13098 bool
13100  DMA_MODULE_ID index ) ;
13101 //******************************************************************************
13102 /* Function : PLIB_DMA_ExistsStartTransfer( DMA_MODULE_ID index )
13103  Summary:
13104  Identifies whether the StartTransfer feature exists on the DMA module.
13105  Description:
13106  This function identifies whether the StartTransfer feature is available on
13107  the DMA module.
13108  When this function returns true, this function is supported on the device:
13109  - PLIB_DMA_StartTransferSet
13110  Preconditions:
13111  None.
13112  Parameters:
13113  index - Identifier for the device instance
13114  Returns:
13115  - true - The StartTransfer feature is supported on the device
13116  - false - The StartTransfer feature is not supported on the device
13117  Remarks:
13118  None.
13119 */
13120 
13121 bool
13123  DMA_MODULE_ID index ) ;
13124 //******************************************************************************
13125 /* Function : PLIB_DMA_ExistsChannelXStartIRQ( DMA_MODULE_ID index )
13126  Summary:
13127  Identifies whether the ChannelXStartIRQ feature exists on the DMA module.
13128  Description:
13129  This function identifies whether the ChannelXStartIRQ feature is available
13130  on the DMA module.
13131  When this function returns true, this function is supported on the device:
13132  - PLIB_DMA_ChannelXStartIRQSet
13133  Preconditions:
13134  None.
13135  Parameters:
13136  index - Identifier for the device instance
13137  Returns:
13138  - true - The ChannelXStartIRQ feature is supported on the device
13139  - false - The ChannelXStartIRQ feature is not supported on the device
13140  Remarks:
13141  None.
13142 */
13143 
13144 bool
13146  DMA_MODULE_ID index ) ;
13147 //******************************************************************************
13148 /* Function : PLIB_DMA_ExistsChannelXAbortIRQ( DMA_MODULE_ID index )
13149  Summary:
13150  Identifies whether the ChannelXAbortIRQ feature exists on the DMA module.
13151  Description:
13152  This function identifies whether the ChannelXAbortIRQ feature is available
13153  on the DMA module.
13154  When this function returns true, this function is supported on the device:
13155  - PLIB_DMA_ChannelXAbortIRQSet
13156  Preconditions:
13157  None.
13158  Parameters:
13159  index - Identifier for the device instance
13160  Returns:
13161  - true - The ChannelXAbortIRQ feature is supported on the device
13162  - false - The ChannelXAbortIRQ feature is not supported on the device
13163  Remarks:
13164  None.
13165 */
13166 
13167 bool
13169  DMA_MODULE_ID index ) ;
13170 //******************************************************************************
13171 /* Function : PLIB_DMA_ExistsChannelXINTSourceFlag( DMA_MODULE_ID index )
13172  Summary:
13173  Identifies whether the ChannelXINTSourceFlag feature exists on the DMA module.
13174  Description:
13175  This function identifies whether the ChannelXINTSourceFlag feature is available
13176  on the DMA module.
13177  When this function returns true, these functions are supported on the device:
13178  - PLIB_DMA_ChannelXINTSourceFlagGet
13179  - PLIB_DMA_ChannelXINTSourceFlagSet
13180  - PLIB_DMA_ChannelXINTSourceFlagClear
13181  Preconditions:
13182  None.
13183  Parameters:
13184  index - Identifier for the device instance
13185  Returns:
13186  - true - The ChannelXINTSourceFlag feature is supported on the device
13187  - false - The ChannelXINTSourceFlag feature is not supported on the device
13188  Remarks:
13189  None.
13190 */
13191 
13192 bool
13194  DMA_MODULE_ID index ) ;
13195 //******************************************************************************
13196 /* Function : PLIB_DMA_ExistsChannelXINTSource( DMA_MODULE_ID index )
13197  Summary:
13198  Identifies whether the ChannelXINTSource feature exists on the DMA module.
13199  Description:
13200  This function identifies whether the ChannelXINTSource feature is available
13201  on the DMA module.
13202  When this function returns true, these functions are supported on the device:
13203  - PLIB_DMA_ChannelXINTSourceEnable
13204  - PLIB_DMA_ChannelXINTSourceDisable
13205  - PLIB_DMA_ChannelXINTSourceIsEnabled
13206  Preconditions:
13207  None.
13208  Parameters:
13209  index - Identifier for the device instance
13210  Returns:
13211  - true - The ChannelXINTSource feature is supported on the device
13212  - false - The ChannelXINTSource feature is not supported on the device
13213  Remarks:
13214  None.
13215 */
13216 
13217 bool
13219  DMA_MODULE_ID index ) ;
13220 //******************************************************************************
13221 /* Function : PLIB_DMA_ExistsChannelXSourceStartAddress( DMA_MODULE_ID index )
13222  Summary:
13223  Identifies whether the ChannelXSourceStartAddress feature exists on the DMA module.
13224  Description:
13225  This function identifies whether the ChannelXSourceStartAddress feature is available
13226  on the DMA module.
13227  When this function returns true, these functions are supported on the device:
13228  - PLIB_DMA_ChannelXSourceStartAddressGet
13229  - PLIB_DMA_ChannelXSourceStartAddressSet
13230  Preconditions:
13231  None.
13232  Parameters:
13233  index - Identifier for the device instance
13234  Returns:
13235  - true - The ChannelXSourceStartAddress feature is supported on the device
13236  - false - The ChannelXSourceStartAddress feature is not supported on the device
13237  Remarks:
13238  None.
13239 */
13240 
13241 bool
13243  DMA_MODULE_ID index ) ;
13244 //******************************************************************************
13245 /* Function : PLIB_DMA_ExistsChannelXDestinationStartAddress( DMA_MODULE_ID index )
13246  Summary:
13247  Identifies whether the ChannelXDestinationStartAddress feature exists on
13248  the DMA module.
13249  Description:
13250  This function identifies whether the ChannelXDestinationStartAddress feature
13251  is available on the DMA module.
13252  When this function returns true, these functions are supported on the device:
13253  - PLIB_DMA_ChannelXDestinationStartAddressGet
13254  - PLIB_DMA_ChannelXDestinationStartAddressSet
13255  Preconditions:
13256  None.
13257  Parameters:
13258  index - Identifier for the device instance
13259  Returns:
13260  - true - The ChannelXDestinationStartAddress feature is supported on the device
13261  - false - The ChannelXDestinationStartAddress feature is not supported on the device
13262  Remarks:
13263  None.
13264 */
13265 
13266 bool
13268  DMA_MODULE_ID index ) ;
13269 //******************************************************************************
13270 /* Function : PLIB_DMA_ExistsChannelXSourceSize( DMA_MODULE_ID index )
13271  Summary:
13272  Identifies whether the ChannelXSourceSize feature exists on the DMA module.
13273  Description:
13274  This function identifies whether the ChannelXSourceSize feature is available
13275  on the DMA module.
13276  When this function returns true, these functions are supported on the device:
13277  - PLIB_DMA_ChannelXSourceSizeGet
13278  - PLIB_DMA_ChannelXSourceSizeSet
13279  Preconditions:
13280  None.
13281  Parameters:
13282  index - Identifier for the device instance
13283  Returns:
13284  - true - The ChannelXSourceSize feature is supported on the device
13285  - false - The ChannelXSourceSize feature is not supported on the device
13286  Remarks:
13287  None.
13288 */
13289 
13290 bool
13292  DMA_MODULE_ID index ) ;
13293 //******************************************************************************
13294 /* Function : PLIB_DMA_ExistsChannelXDestinationSize( DMA_MODULE_ID index )
13295  Summary:
13296  Identifies whether the ChannelXDestinationSize feature exists on the DMA module.
13297  Description:
13298  This function identifies whether the ChannelXDestinationSize feature is available
13299  on the DMA module.
13300  When this function returns true, these functions are supported on the device:
13301  - PLIB_DMA_ChannelXDestinationSizeGet
13302  - PLIB_DMA_ChannelXDestinationSizeSet
13303  Preconditions:
13304  None.
13305  Parameters:
13306  index - Identifier for the device instance
13307  Returns:
13308  - true - The ChannelXDestinationSize feature is supported on the device
13309  - false - The ChannelXDestinationSize feature is not supported on the device
13310  Remarks:
13311  None.
13312 */
13313 
13314 bool
13316  DMA_MODULE_ID index ) ;
13317 //******************************************************************************
13318 /* Function : PLIB_DMA_ExistsChannelXSourcePointer( DMA_MODULE_ID index )
13319  Summary:
13320  Identifies whether the ChannelXSourcePointer feature exists on the DMA module.
13321  Description:
13322  This function identifies whether the ChannelXSourcePointer feature is available
13323  on the DMA module.
13324  When this function returns true, this function is supported on the device:
13325  - PLIB_DMA_ChannelXSourcePointerGet
13326  Preconditions:
13327  None.
13328  Parameters:
13329  index - Identifier for the device instance
13330  Returns:
13331  - true - The ChannelXSourcePointer feature is supported on the device
13332  - false - The ChannelXSourcePointer feature is not supported on the device
13333  Remarks:
13334  None.
13335 */
13336 
13337 bool
13339  DMA_MODULE_ID index ) ;
13340 //******************************************************************************
13341 /* Function : PLIB_DMA_ExistsChannelXDestinationPointer( DMA_MODULE_ID index )
13342  Summary:
13343  Identifies whether the ChannelXDestinationPointer feature exists on the DMA module.
13344  Description:
13345  This function identifies whether the ChannelXDestinationPointer feature is available
13346  on the DMA module.
13347  When this function returns true, this function is supported on the device:
13348  - PLIB_DMA_ChannelXDestinationPointerGet
13349  Preconditions:
13350  None.
13351  Parameters:
13352  index - Identifier for the device instance
13353  Returns:
13354  - true - The ChannelXDestinationPointer feature is supported on the device
13355  - false - The ChannelXDestinationPointer feature is not supported on the device
13356  Remarks:
13357  None.
13358 */
13359 
13360 bool
13362  DMA_MODULE_ID index ) ;
13363 //******************************************************************************
13364 /* Function : PLIB_DMA_ExistsChannelXCellSize( DMA_MODULE_ID index )
13365  Summary:
13366  Identifies whether the ChannelXCellSize feature exists on the DMA module.
13367  Description:
13368  This function identifies whether the ChannelXCellSize feature is available on
13369  the DMA module.
13370  When this function returns true, these functions are supported on the device:
13371  - PLIB_DMA_ChannelXCellSizeGet
13372  - PLIB_DMA_ChannelXCellSizeSet
13373  Preconditions:
13374  None.
13375  Parameters:
13376  index - Identifier for the device instance
13377  Returns:
13378  - true - The ChannelXCellSize feature is supported on the device
13379  - false - The ChannelXCellSize feature is not supported on the device
13380  Remarks:
13381  None.
13382 */
13383 
13384 bool
13386  DMA_MODULE_ID index ) ;
13387 //******************************************************************************
13388 /* Function : PLIB_DMA_ExistsChannelXCellProgressPointer( DMA_MODULE_ID index )
13389  Summary:
13390  Identifies whether the ChannelXCellProgressPointer feature exists on the
13391  DMA module.
13392  Description:
13393  This function identifies whether the ChannelXCellProgressPointer feature is
13394  available on the DMA module.
13395  When this function returns true, this function is supported on the device:
13396  - PLIB_DMA_ChannelXCellProgressPointerGet
13397  Preconditions:
13398  None.
13399  Parameters:
13400  index - Identifier for the device instance
13401  Returns:
13402  - true - The ChannelXCellProgressPointer feature is supported on the device
13403  - false - The ChannelXCellProgressPointer feature is not supported on the device
13404  Remarks:
13405  None.
13406 */
13407 
13408 bool
13410  DMA_MODULE_ID index ) ;
13411 //******************************************************************************
13412 /* Function : PLIB_DMA_ExistsChannelXPatternData( DMA_MODULE_ID index )
13413  Summary:
13414  Identifies whether the ChannelXPatternData feature exists on the DMA module
13415  Description:
13416  This function identifies whether the ChannelXPatternData feature is available
13417  on the DMA module.
13418  When this function returns true, these functions are supported on the device:
13419  - PLIB_DMA_ChannelXPatternDataGet
13420  - PLIB_DMA_ChannelXPatternDataSet
13421  Preconditions:
13422  None.
13423  Parameters:
13424  index - Identifier for the device instance
13425  Returns:
13426  - true - The ChannelXPatternData feature is supported on the device
13427  - false - The ChannelXPatternData feature is not supported on the device
13428  Remarks:
13429  None.
13430 */
13431 
13432 bool
13434  DMA_MODULE_ID index ) ;
13435 //DOM-IGNORE-BEGIN
13436 //DOM-IGNORE-END
13437  // #ifndef _PLIB_DMA_H
13438 /*******************************************************************************
13439  End of File
13440 */
13441 
13442 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h*/
13443 /* CLOSE_FILE Include File */
13444 
13445 // *****************************************************************************
13446 // *****************************************************************************
13447 // Section: Data Types
13448 // *****************************************************************************
13449 // *****************************************************************************
13450 // *****************************************************************************
13451 /* DMA System Service Channel None
13452  Summary:
13453  DMA channel none
13454  Description:
13455  This constant identifies the specification of no choice from client
13456  for allocating a particular DMA channel.
13457  Remarks:
13458  This constant should be used in place of hard-coded numeric literals.
13459 */
13460 //DOM-IGNORE-BEGIN
13461 #define DMA_CHANNEL_NONE ( ( DMA_CHANNEL ) - 1 )
13462 //DOM-IGNORE-END
13463 // *****************************************************************************
13464 /* DMA System Service Channel Any
13465  Summary:
13466  Identifies the client specification to allocate any available DMA channel.
13467  Description:
13468  This constant identifies the specification by the client
13469  to allocate any available DMA channel.
13470  Remarks:
13471  This constant should be used in place of hard-coded numeric literals.
13472 */
13473 //DOM-IGNORE-BEGIN
13474 #define DMA_CHANNEL_ANY ( ( DMA_CHANNEL ) - 2 )
13475 //DOM-IGNORE-END
13476 // *****************************************************************************
13477 /* DMA System Service Channel Count
13478  Summary:
13479  Identifies the maximum number of DMA channel handles to be defined.
13480  Description:
13481  This constant identifies the maximum number of DMA channel handles
13482  that should be defined.
13483  Remarks:
13484  This value is derived from device-specific header files defined as
13485  part of the peripheral libraries.
13486 */
13487 #define SYS_DMA_CHANNEL_COUNT DMA_NUMBER_OF_CHANNELS
13488 // *****************************************************************************
13489 /* DMA System Service Channel Handle
13490  Summary:
13491  Assigns the handle for requested channel.
13492  Description:
13493  A channel handle value is returned by a call to the SYS_DMA_ChannelAllocate
13494  function. This handle is associated with the channel number that is used for
13495  data transfer and it allows the application to track the data transfer.
13496  The channel handle once assigned to a client expires when the
13497  client calls SYS_DMA_ChannelRelease.
13498  exits.
13499  Remarks:
13500  None.
13501 */
13502 
13503 typedef
13504 uintptr_t
13506 // *****************************************************************************
13507 /* DMA System Service Invalid Channel Handle
13508  Summary:
13509  Defines an invalid channel handle.
13510  Description:
13511  This is the definition of an invalid channel handle. An invalid buffer handle
13512  is returned by SYS_DMA_ChannelAllocate function if the channel number
13513  request was not successful.
13514  Remarks:
13515  None.
13516 */
13517 #define SYS_DMA_CHANNEL_HANDLE_INVALID ( ( SYS_DMA_CHANNEL_HANDLE ) ( - 1 ) )
13518 // *****************************************************************************
13519 /* DMA stop in idle mode
13520  Summary:
13521  Enable/Disable DMA operations in Idle mode.
13522  Description:
13523  This data type allows enabling/disabling of DMA operations in idle mode.
13524  Remarks:
13525  The field 'sidl' (in init data structure 'SYS_DMA_INIT') is enable/disable
13526  while initializing the DMA module by calling SYS_DMA_Initialize.
13527  This feature may not be available on all devices. Refer to the specific device
13528  data sheet to determine availability.
13529 */
13530 
13531 typedef
13532  enum
13533  {
13534  /* When the CPU enters idle mode, the DMA module continue operations */
13536  /* When the CPU enters idle mode, the DMA module will discontinue operations */
13538  } SYS_DMA_SIDL ;
13539 // *****************************************************************************
13540 /* DMA Channel chaining priority
13541  Summary:
13542  Identifies the priority of chaining channel.
13543  Description:
13544  This data type identifies the priority of chaining channel.
13545  Channel chaining priority identifies the channel that will be enabled
13546  on completion of block data transfer on the master channel.
13547  Remarks:
13548  None.
13549 */
13550 
13551 typedef
13552  enum
13553  {
13554  /* Chain to channel higher in natural priority */
13556  /* Chain to channel lower in natural priority */
13559 // *****************************************************************************
13560 /* DMA Channel ignore pattern match
13561  Summary:
13562  Enables/Disables the feature to ignore a byte between a 2-byte match abort
13563  pattern.
13564  Description:
13565  This data type allows enabling/disabling the feature to ignore a byte
13566  between a 2-byte match abort pattern.
13567  Remarks:
13568  This feature may not be available on all devices. Refer to the specific device
13569  data sheet to determine availability.
13570 */
13571 
13572 typedef
13573  enum
13574  {
13575  /* Disabling the feature to ignore a byte between a 2-byte match abort pattern. */
13577  /* Enable the feature to ignore a byte between a 2-byte match abort pattern. */
13580 // *****************************************************************************
13581 /* DMA channel CRC mode
13582  Summary:
13583  Identifies the operation mode of the CRC module.
13584  Description:
13585  This data type identifies CRC operating mode. The CRC computation can be
13586  in background mode or append mode.
13587  Remarks:
13588  None.
13589 */
13590 
13591 typedef
13592  enum
13593  {
13594  /* DMA reads the data from the source, passes it through the CRC module and
13595  writes it to the destination. the calculated CRC is left in the DCRCDATA
13596  register at the end of the block transfer. */
13598  /* DMA only feeds source data to the CRC module. it does not write source data
13599  to the destination address. When a block transfer complete or pattern abort
13600  event occur, The DMA writes the CRC value to the destination address */
13603 // *****************************************************************************
13604 /* DMA channel CRC write order
13605  Summary:
13606  Identifies altering/maintaining write order post CRC computation.
13607  Description:
13608  This data type identifies write byte order selection post CRC
13609  computation.
13610  Remarks:
13611  None.
13612 */
13613 
13614 typedef
13615  enum
13616  {
13617  /* Source data is written to the destination unchanged regardless
13618  of the selected pre-CRC byte order. */
13620  /* Source data is written to the destination reordered according
13621  to the selected pre-CRC byte order. */
13624 // *****************************************************************************
13625 /* DMA channel operation modes
13626  Summary:
13627  Identifies the available DMA operating modes.
13628  Description:
13629  This data type Identifies the available DMA operating modes.
13630  The supported DMA modes are not mutually exclusive, but can be simultaneously
13631  operational.
13632  Remarks:
13633  These supported DMA modes can be logically OR'd together. They are passed
13634  into the SYS_DMA_ChannelSetup function through the modeEnable parameter.
13635 */
13636 
13637 typedef
13638  enum
13639  {
13640  /* The normal DMA operation mode. The DMA channel will transfer data from
13641  a source to a destination without CPU intervention */
13642  SYS_DMA_CHANNEL_OP_MODE_BASIC /*DOM-IGNORE-BEGIN*/
13643  = ( 1 << 0 ) /*DOM-IGNORE-END*/
13644  ,
13645  /* Pattern Match abort mode allows the user to end a transfer if data
13646  written during a transaction matches a specific pattern, as defined by
13647  the DCHxDAT register */
13649  = ( 1 << 1 ) /*DOM-IGNORE-END*/
13650  ,
13651  /* Channel chaining operating mode enhances the normal DMA channel
13652  operations. A channel(slave) can be chained to an adjacent channel(master).
13653  The slave channel will be enabled when a block transfer of the master
13654  channel completes. */
13655  /* only one of the below two chaining priorities must be provided.
13656  Chaining priority High. */
13658  = ( 1 << 2 ) /*DOM-IGNORE-END*/
13659  ,
13660  /* Chaining priority Low */
13662  = ( 1 << 3 ) /*DOM-IGNORE-END*/
13663  ,
13664  /* Auto enable operating mode allows a channel to be kept active, even if a
13665  block transfer completes or pattern match occurs. This prevents the user
13666  from having to re-enable the channel each time a block transfer completes. */
13667  SYS_DMA_CHANNEL_OP_MODE_AUTO/*DOM-IGNORE-BEGIN*/
13668  = ( 1 << 4 ) /*DOM-IGNORE-END*/
13669  ,
13670  /* CRC operating mode allows computation of 16, 32-bit CRC. */
13671  SYS_DMA_CHANNEL_OP_MODE_CRC/*DOM-IGNORE-BEGIN*/
13672  = ( 1 << 5 ) /*DOM-IGNORE-END*/
13674 // *****************************************************************************
13675 /* DMA channel CRC mode
13676  Summary:
13677  Defines the attributes for CRC operation mode.
13678  Description:
13679  This data type defines the attributes for CRC operation mode.
13680  Remarks:
13681  This feature may not be available on all devices. Refer to the specific device
13682  data sheet to determine availability.
13683 */
13684 
13685 typedef
13686  struct
13687  {
13688  /* CRC type (PLIB-level).
13689  Type Selection identifies whether the CRC module will calculate an IP
13690  header checksum or an LFSR CRC */
13691  DMA_CRC_TYPE type ;
13692  /* CRC mode, Background or Append */
13694  /* Polynomial length, This value is redundant when the selected CRC type is
13695  IP header checksum. When the CRC type is LFSR, Identifies the length of
13696  the polynomial. */
13697  uint8_t polyLength ;
13698  /* Bit order (PLIB-level).
13699  Identifies whether the CRC is computed LSb or MSb first */
13700  DMA_CRC_BIT_ORDER bitOrder ;
13701  /* Byte order (PLIB-level).
13702  Identifies the byte selection order input pre-CRC Generator. */
13703  DMA_CRC_BYTE_ORDER byteOrder ;
13704  /* Post CRC Write order */
13705  SYS_DMA_CRC_WRITE_ORDER writeOrder ;
13706  /* CRC data feed: While enabling the CRC mode, this field gives
13707  the seed for the CRC computation. On block transfer complete or
13708  pattern match abort the field have the computed CRC. */
13709  uint32_t data ;
13710  /* XOR bit mask, This value is redundant when the selected CRC type is
13711  IP header checksum. When the CRC type is LFSR, Identifies the XOR
13712  bit mask input to the shift register during CRC computation. */
13713  uint32_t xorBitMask ;
13715 // *****************************************************************************
13716 /* DMA System service Events
13717  Summary:
13718  Enumeration of possible DMA System service events.
13719  Description:
13720  This data type provides an enumeration of all possible DMA System service events.
13721  Remarks:
13722  None.
13723 */
13724 
13725 typedef
13726  enum
13727  {
13728  /* Data was transferred successfully. */
13730  /* Error while processing the request */
13732  /* Data transfer was aborted. */
13734  /* No events yet. */
13737 // *****************************************************************************
13738 /* DMA System service Error
13739  Summary:
13740  Indicates the error information for the DMA System service.
13741  Description:
13742  This enumeration indicates the error information for the DMA System service.
13743  Remarks:
13744  None.
13745 */
13746 
13747 typedef
13748  enum
13749  {
13750  /* Data was transferred successfully. */
13751  SYS_DMA_ERROR_NONE /*DOM-IGNORE-BEGIN*/
13752  = 1 << 0 ,
13753  /* DOM-IGNORE-END*/
13754  /* DMA address error. */
13755  SYS_DMA_ERROR_ADDRESS_ERROR /*DOM-IGNORE-BEGIN*/
13756  = 1 << 1 /* DOM-IGNORE-END*/
13757  } SYS_DMA_ERROR ;
13758 // *****************************************************************************
13759 /* DMA Initialization data
13760  Summary:
13761  Defines the data required to initialize the DMA subsystem.
13762  Description:
13763  This data type defines the data required to initialize the DMA subsystem.
13764  Remarks:
13765  This feature may not be available on all devices. Refer to the specific device
13766  data sheet to determine availability.
13767 */
13768 
13769 typedef
13770  struct
13771  {
13772  /* Enable/Disable stop in idle mode feature */
13773  SYS_DMA_SIDL sidl ;
13774  } SYS_DMA_INIT ;
13775 // *****************************************************************************
13776 /* Data width options */
13777 
13778 typedef
13779  enum
13780  {
13781  /* Data width configuration feature is not available */
13783  } SYS_DMA_DATA_WIDTH ;
13784 // *****************************************************************************
13785 /* DMA descriptor control
13786  Summary:
13787  Defines the descriptor control for linked list operation.
13788  Description:
13789  This data type defines the descriptor control for linked list operation.
13790  Remarks:
13791  This feature may not be available on all devices. Refer to the specific device
13792  data sheet to determine availability.
13793 */
13794 
13795 typedef
13796  union
13797  {
13798  /* Feature is not supported */
13799  ;
13801 // *****************************************************************************
13802 // *****************************************************************************
13803 // Section: Initialization and Task Functions
13804 // *****************************************************************************
13805 // *****************************************************************************
13806 //******************************************************************************
13807 /* Function:
13808  void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
13809  Summary:
13810  Maintains the system service's state machine.
13811 
13812  Description:
13813  This function is used to maintain the DMA system service's internal state
13814  machine. This function services events on a specific DMA channel.
13815  Precondition:
13816  DMA should have been initialized by calling SYS_DMA_Initialize.
13817  Parameters:
13818  object - Object handle for the DMA module (returned from
13819  SYS_DMA_Initialize)
13820  activeChannel - DMA channel number to be serviced.
13821  Returns:
13822  None.
13823  Example:
13824  <code>
13825  // 'object' Returned from SYS_DMA_Initialize
13826  void __ISR(_DMA3_VECTOR,ipl5)_InterruptHandler_BT_USART_RX_DMA_CHANNEL(void)
13827  {
13828  SYS_DMA_Tasks(object, DMA_CHANNEL_3);
13829  }
13830  </code>
13831  Remarks:
13832  This function is normally not called directly by an application. It is
13833  called by the system's task/interrupt routines.
13834  */
13835 
13836 void
13837  SYS_DMA_Tasks (
13838  SYS_MODULE_OBJ object ,
13839  DMA_CHANNEL activeChannel ) ;
13840 //******************************************************************************
13841 /* For backward compatibility */
13842 #define SYS_DMA_TasksISR( object , activeChannel ) SYS_DMA_Tasks ( object , activeChannel )
13843  // #ifndef _SYS_DMA_DEFINITIONS_H
13844 /*******************************************************************************
13845  End of File
13846 */
13847 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h*/
13848 /* CLOSE_FILE Include File */
13849 
13850 // DOM-IGNORE-BEGIN
13851 // DOM-IGNORE-END
13852 // *****************************************************************************
13853 // *****************************************************************************
13854 // Section: DMA System Service Interface Routines
13855 // *****************************************************************************
13856 // *****************************************************************************
13857 // *****************************************************************************
13858 /* DMA System service Transfer Event Handler Function
13859  Summary:
13860  Pointer to a DMA System service Transfer Event handler function.
13861  Description:
13862  This data type defines a DMA System service Transfer Event Handler Function.
13863  A DMA system service client must register an transfer event handler function of
13864  this type to receive transfer related events from the system service.
13865  If the event is SYS_DMA_TRANSFER_EVENT_COMPLETE, this means that the data
13866  was transferred successfully. The channelHandle parameter contains the channel
13867  handle of the channel on which the transfer was processed.
13868  If the event is SYS_DMA_TRANSFER_EVENT_ERROR, this means that the data was
13869  not transferred successfully. TThe channelHandle parameter contains the channel
13870  handle of the channel on which the transfer had failed.
13871  The contextHandle parameter contains the context handle that was provided by
13872  the client at the time of registering the event handler. This context handle
13873  can be anything that the client consider helpful or necessary to identify
13874  the client context object associated with the channel of the system
13875  service that generated the event.
13876  The event handler function executes in an interrupt context when DMA is setup
13877  to start operation by an interrupt trigger source. It is recommended of the
13878  application to not perform process intensive operations with in this
13879  function.
13880  Remarks:
13881  None.
13882 */
13883 
13884 typedef
13886 SYS_DMA_CHANNEL_HANDLE handle ,
13887 uintptr_t contextHandle ) ;
13888 // *****************************************************************************
13889 // *****************************************************************************
13890 // Section: Initialization and Task Functions
13891 // *****************************************************************************
13892 // *****************************************************************************
13893 //******************************************************************************
13894 /* Function:
13895  SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT * const init)
13896  Summary:
13897  Initializes and Enables the DMA Controller.
13898  Description:
13899  This function Enables the DMA module. Enable/Disable stop in idle mode
13900  feature based on the passed parameter value.
13901  This function initializes the DMA module making it ready for clients to
13902  open and use it. The initialization data is specified by the init parameter.
13903  Precondition:
13904  None.
13905  Parameters:
13906  init - Pointer to the data structure containing any data
13907  necessary to initialize the hardware. This pointer may
13908  be null if no data is required and default
13909  initialization is to be used.
13910  Returns:
13911  If successful, returns a valid handle to the DMA module object.
13912  Otherwise, it returns SYS_MODULE_OBJ_INVALID.
13913  Example:
13914  <code>
13915  SYS_MODULE_OBJ objectHandle;
13916  SYS_DMA_INIT initParam;
13917  initParam.sidl = SYS_DMA_SIDL_ENABLE;
13918  objectHandle = SYS_DMA_Initialize(DRV_I2S_INDEX_1,
13919  (SYS_MODULE_INIT*)initParam);
13920  if (SYS_MODULE_OBJ_INVALID == objectHandle)
13921  {
13922  // Handle error
13923  }
13924  </code>
13925  Remarks:
13926  This function must be called before any other DMA systems service routines
13927  are called.
13928  Not all features are available on all micro-controllers.
13929 */
13930 
13931 SYS_MODULE_OBJ
13933  const SYS_MODULE_INIT * const init ) ;
13934 // *****************************************************************************
13935 // *****************************************************************************
13936 // Section: Channel Setup and management functions
13937 // *****************************************************************************
13938 // *****************************************************************************
13939 //******************************************************************************
13940 /* Function:
13941  SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate (DMA_CHANNEL channel)
13942  Summary:
13943  Allocates the specified DMA channel and returns a handle to it.
13944  Description:
13945  This function opens the specified DMA channel and provides a
13946  handle that must be provided to all other client-level operations to
13947  identify the caller and the DMA channel.
13948  Precondition:
13949  Function SYS_DMA_Initialize must have been called before calling this
13950  function.
13951  Parameters:
13952  channel - Channel number requested for allocation.
13953  When channel number specified is DMA_CHANNEL_ANY
13954  a random channel is allocated for DMA transfers.
13955  Returns:
13956  The channel handle for the requested channel number.
13957  If an error occurs, the return value is SYS_DMA_CHANNEL_HANDLE_INVALID.
13958  Error can occur.
13959  - if the requested channel number is invalid.
13960  - if the requested channel number is not free.
13961  Example:
13962  <code>
13963  DMA_CHANNEL channel;
13964  SYS_DMA_CHANNEL_HANDLE handle
13965  channel = DMA_CHANNEL_2;
13966  handle = SYS_DMA_ChannelAllocate(channel);
13967  if (SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
13968  {
13969  // Failed to allocate the channel
13970  }
13971  else
13972  {
13973  // Proceed with setting up the channel and adding the transfer
13974  }
13975  </code>
13976  Remarks:
13977  The handle returned is valid until the SYS_DMA_ChannelRelease routine is called.
13978  This function must be called before any other DMA channel Setup and management
13979  routines are called
13980 */
13981 
13984  DMA_CHANNEL channel ) ;
13985 //******************************************************************************
13986 /* Function:
13987  void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
13988  Summary:
13989  Deallocates and frees the channel specified by the handle.
13990  Description:
13991  This function deallocates an allocated-channel of the DMA module,
13992  invalidating the handle.
13993  Precondition:
13994  DMA should have been initialized by calling SYS_DMA_Initialize.
13995  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate
13996  Parameters:
13997  handle - A valid allocated-channel handle, returned from the service's
13998  Allocate routine
13999  Returns:
14000  None.
14001  Example:
14002  <code>
14003  DMA_CHANNEL channel;
14004  SYS_DMA_CHANNEL_HANDLE handle;
14005  channel = DMA_CHANNEL_2;
14006  handle = SYS_DMA_ChannelAllocate(channel);
14007  SYS_DMA_ChannelRelease(handle);
14008  </code>
14009  Remarks:
14010  After calling this routine, the handle passed in "handle" must not be used
14011  with any of the remaining service's routines. A new handle must be obtained by
14012  calling SYS_DMA_ChannelAllocate before the caller may use the service again
14013 */
14014 
14015 void
14017  SYS_DMA_CHANNEL_HANDLE handle ) ;
14018 //******************************************************************************
14019 /* Function:
14020  void SYS_DMA_ChannelSetup
14021  (
14022  SYS_DMA_CHANNEL_HANDLE handle,
14023  SYS_DMA_CHANNEL_OP_MODE modeEnable
14024  DMA_TRIGGER_SOURCE eventSrc
14025  )
14026  Summary:
14027  Setup the DMA channel parameters.
14028  Description:
14029  This function sets up the DMA channel parameters.
14030  It sets the channel priority and enables the mode of operations for the
14031  current system design.
14032  Precondition:
14033  DMA should have been initialized by calling SYS_DMA_Initialize.
14034  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14035  Parameters:
14036  handle - Handle of the DMA channel as returned by the
14037  SYS_DMA_ChannelAllocate function.
14038  priority - The priority to be associated to the channel.
14039  modeEnable - The supported operating modes to be enabled.
14040  This parameter can be logically ORed to specify
14041  multiple options.
14042  eventSrc - The event causing the cell transfer start.
14043  Returns:
14044  None.
14045  Example:
14046  <code>
14047  // 'handle' is a valid handle returned
14048  // by the SYS_DMA_ChannelAllocate function.
14049  SYS_DMA_CHANNEL_OP_MODE modeEnable;
14050  DMA_TRIGGER_SOURCE eventSrc;
14051  channel = DMA_CHANNEL_2;
14052  modeEnable = (SYS_DMA_CHANNEL_OP_MODE_BASIC | SYS_DMA_CHANNEL_OP_MODE_CRC);
14053  eventSrc = DMA_TRIGGER_USART_1_TRANSMIT;
14054  // Setup channel number, and enables basic and CRC mode
14055  SYS_DMA_ChannelSetup(handle, modeEnable,eventSrc);
14056  </code>
14057  Remarks:
14058  If SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT, SYS_DMA_CHANNEL_OP_MODE_CHAIN or
14059  SYS_DMA_CHANNEL_OP_MODE_CRC mode of operation is enabled, then corresponding
14060  mode setup API's needs to be called to set the related parameters.
14061  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE then
14062  SYS_DMA_ChannelForceStart must be called to start the DMA channel transfer.
14063  Not all features are available on all microcontrollers.
14064  */
14065 
14066 void
14068  SYS_DMA_CHANNEL_HANDLE handle ,
14069  SYS_DMA_CHANNEL_OP_MODE modeEnable ,
14070  DMA_TRIGGER_SOURCE eventSrc ) ;
14071 //******************************************************************************
14072 /* Function:
14073  void SYS_DMA_ChannelSetupMatchAbortMode
14074  (
14075  SYS_DMA_CHANNEL_HANDLE handle,
14076  uint16_t pattern,
14077  DMA_PATTERN_LENGTH length,
14078  SYS_DMA_CHANNEL_IGNORE_MATCH ignore,
14079  uint8_t ignorePattern
14080  )
14081  Summary:
14082  Setup the pattern match abort mode.
14083  Description:
14084  This function sets up the termination of DMA operation when the specified
14085  pattern is matched. Additionally on supported parts the function also
14086  sets up the ignoring of part of a pattern(8-bit) from match abort
14087  pattern(16-bit).
14088  Precondition:
14089  DMA should have been initialized by calling SYS_DMA_Initialize.
14090  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14091  The function SYS_DMA_ChannelSetup must be called to enable
14092  SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT before setting up pattern
14093  match mode features.
14094  Parameters:
14095  handle - Handle of the DMA channel as returned by the
14096  SYS_DMA_ChannelAllocate function.
14097  pattern - The pattern that needs to be matched to abort a DMA transfer.
14098  length - Match pattern length can be 1-byte or 2-byte.
14099  ignore - Enable/Disable a byte between a 2-byte pattern match.
14100  ignorePattern - The part of the pattern(8-bit) that needs to be ignored
14101  from the match abort pattern(16-bit)
14102  Returns:
14103  None.
14104  Example:
14105  <code>
14106  // Example 1
14107  // The following code is for a device with an 8-bit pattern value and no
14108  // support for pattern match ignore feature
14109  // 'handle' is a valid handle returned
14110  // by the SYS_DMA_ChannelAllocate function.
14111  uint16_t pattern;
14112  DMA_PATTERN_LENGTH length;
14113  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
14114  uint8_t ignorePattern;
14115  pattern = 0x00; //Stop transfer on detection of a NULL character
14116  length = DMA_PATTERN_LENGTH_NONE;
14117  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_DISABLE;
14118  ignorePattern = 0;
14119  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
14120  ignoreEnable, ignorePattern);
14121  // Example 2
14122  // The following code is for a device with a 16-bit pattern value and
14123  // support for pattern match ignore feature
14124  // 'handle' is a valid handle returned
14125  // by the SYS_DMA_ChannelAllocate function.
14126  uint16_t pattern;
14127  DMA_PATTERN_LENGTH length;
14128  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
14129  uint8_t ignorePattern;
14130  pattern = 0x0D0A; //Stop transfer on detection of '\r\n'
14131  length = DMA_PATTERN_MATCH_LENGTH_2BYTES;
14132  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_ENABLE;
14133  ignorePattern = 0x00; \\ Any null character between the termination pattern
14134  \\ '\r' and '\n' is ignored.
14135  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
14136  ignore, ignorePattern);
14137  </code>
14138  Remarks:
14139  The parameter 'pattern' (8-bit or 16-bit) is device-specific.
14140  Not all features are available on all devices.
14141  Refer to the specific device data sheet for details.
14142 */
14143 
14144 void
14146  SYS_DMA_CHANNEL_HANDLE handle ,
14147  uint16_t pattern ,
14148  DMA_PATTERN_LENGTH length ,
14150  uint8_t ignorePattern ) ;
14151 //******************************************************************************
14152 /* Function:
14153  void SYS_DMA_ChannelCRCSet
14154  (
14155  SYS_DMA_CHANNEL_HANDLE handle,
14156  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc
14157  )
14158  Summary:
14159  Sets up the CRC operation mode.
14160  Description:
14161  This function sets up the CRC computation features.
14162  Precondition:
14163  DMA should have been initialized by calling SYS_DMA_Initialize.
14164  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14165  The function SYS_DMA_ChannelSetup must be called to enable
14166  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
14167  Parameters:
14168  handle - Handle of the DMA channel as returned by the
14169  SYS_DMA_ChannelAllocate function.
14170  crc.type - CRC will calculate an IP header checksum or an LFSR CRC.
14171  crc.mode - Compute the CRC in Background/Append mode.
14172  crc.polyLength - Denotes the length of the polynomial.
14173  crc.bitOrder - CRC is calculated LSb/MSb first.
14174  crc.byteOrder - Byte selection order input pre-CRC Generator
14175  crc.writeOrder - Write byte order selection post-CRC computation
14176  crc.data - Computed/Seed CRC
14177  crc.xorBitMask - Enable/Disable XOR bit mask on the corresponding bits
14178  when mode is LFSR
14179  Returns:
14180  None.
14181  Example:
14182  <code>
14183  //Example 1
14184  // DMA calculation using the CRC background mode
14185  // 'handle' is a valid handle returned
14186  // by the SYS_DMA_ChannelAllocate function.
14187  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc;
14188  crc.type = DMA_CRC_LFSR;
14189  crc.mode = SYS_DMA_CHANNEL_CRC_MODE_BACKGROUND;
14190  crc.polyLength = 16;
14191  crc.bitOrder = DMA_CRC_BIT_ORDER_LSB;
14192  crc.byteOrder = DMA_CRC_BYTEORDER_NO_SWAPPING;
14193  crc.writeOrder = SYS_DMA_CRC_WRITE_ORDER_MAINTAIN;
14194  crc.data = 0xFFFF;
14195  crc.xorBitMask = 0x1021;
14196  SYS_DMA_ChannelCRCSet(handle, crc);
14197  </code>
14198  Remarks:
14199  This feature may not be available on all devices. Refer to the specific device
14200  data sheet to determine availability.
14201 */
14202 
14203 void
14205  SYS_DMA_CHANNEL_HANDLE handle ,
14207 //******************************************************************************
14208 /* Function:
14209  uint32_t SYS_DMA_ChannelCRCGet(void)
14210  Summary:
14211  Returns the computed CRC.
14212  Description:
14213  This function returns the computed CRC
14214  Precondition:
14215  DMA should have been initialized by calling SYS_DMA_Initialize.
14216  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14217  The function SYS_DMA_ChannelSetup must be called to enable
14218  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
14219  The CRC generator must have been previously setup using
14220  SYS_DMA_ChannelCRCSet.
14221  Parameters:
14222  None
14223  Returns:
14224  uint32_t - The Computed CRC.
14225  Example:
14226  <code>
14227  uint32_t computedCRC;
14228  computedCRC = SYS_DMA_ChannelCRCGet();
14229  </code>
14230  Remarks:
14231  To get the computed CRC value this function must be called after the block
14232  transfer completion event (i.e., after getting and processing the callback
14233  registered with SYS_DMA_ChannelTransferEventHandlerSet).
14234  This feature may not be available on all devices. Refer to the specific device
14235  data sheet to determine availability.
14236 */
14237 
14238 uint32_t
14239  SYS_DMA_ChannelCRCGet ( void ) ;
14240 //******************************************************************************
14241 /* Function:
14242  void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
14243  Summary:
14244  Enables a channel.
14245  Description:
14246  This function enables a channel.
14247  Precondition:
14248  DMA should have been initialized by calling SYS_DMA_Initialize.
14249  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14250  The function SYS_DMA_ChannelSetup must have been called to setup and
14251  enable the required features.
14252  Parameters:
14253  handle - Handle of the DMA channel as returned by the
14254  SYS_DMA_ChannelAllocate function.
14255  Returns:
14256  None.
14257  Example:
14258  <code>
14259  // 'handle' is a valid handle returned
14260  // by the SYS_DMA_ChannelAllocate function.
14261  SYS_DMA_ChannelEnable(handle);
14262  </code>
14263  Remarks:
14264  This function may not required to be called when starting DMA setup
14265  (by SYS_DMA_ChannelSetup) and transfer Add (by SYS_DMA_ChannelTransferAdd).
14266  But may be needed to be called in the registered callback to enable the
14267  channel and continue the data transfer with the existing transfer parameters
14268  previously set with 'SYS_DMA_ChannelTransferAdd'.
14269  The DMA channel is by default disabled on the completion of block
14270  transfer(callback generated)
14271 */
14272 
14273 void
14275  SYS_DMA_CHANNEL_HANDLE handle ) ;
14276 //******************************************************************************
14277 /* Function:
14278  void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
14279  Summary:
14280  Disables a channel.
14281  Description:
14282  This function disables a channel.
14283  Precondition:
14284  DMA should have been initialized by calling SYS_DMA_Initialize.
14285  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14286  The function SYS_DMA_ChannelSetup must have been called to setup and
14287  enable the required features.
14288  A DMA channel should have been enabled either by calling
14289  'SYS_DMA_ChannelTransferAdd' or 'SYS_DMA_ChannelEnable'
14290  Parameters:
14291  handle - Handle of the DMA channel as returned by the
14292  SYS_DMA_ChannelAllocate function.
14293  Returns:
14294  None.
14295  Example:
14296  <code>
14297  // 'handle' is a valid handle returned
14298  // by the SYS_DMA_ChannelAllocate function.
14299  SYS_DMA_ChannelDisable(handle);
14300  </code>
14301  Remarks:
14302  None.
14303 */
14304 
14305 void
14307  SYS_DMA_CHANNEL_HANDLE handle ) ;
14308 //******************************************************************************
14309 /* Function:
14310  void SYS_DMA_ChannelTransferAdd
14311  (
14312  SYS_DMA_CHANNEL_HANDLE handle,
14313  const void *srcAddr, size_t srcSize
14314  const void *destAddr, size_t destSize,
14315  size_t cellSize
14316  )
14317  Summary:
14318  Adds a data transfer to a DMA channel and Enables the channel to start
14319  data transfer.
14320  Description:
14321  This function adds a data transfer characteristics for a DMA channel. The
14322  The source and the destination addresses, source and destination lengths,
14323  The number of bytes transferred per cell event are set. It also enables
14324  the channel to start data transfer.
14325  If the requesting client registered an event callback with the service,
14326  the service will issue a SYS_DMA_TRANSFER_EVENT_COMPLETE or
14327  SYS_DMA_TRANSFER_EVENT_ABORT event if the transfered was processed
14328  successfully of SYS_DMA_TRANSFER_EVENT_ERROR event if the transfer was not
14329  processed successfully.
14330  Precondition:
14331  DMA should have been initialized by calling SYS_DMA_Initialize.
14332  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14333  The function SYS_DMA_ChannelSetup must have been called to setup and
14334  enable the required features.
14335  Parameters:
14336  handle - Handle of the DMA channel as returned by the
14337  SYS_DMA_ChannelAllocate function.
14338  srcAddr - Source of the DMA transfer
14339  srcSize - Size of the source
14340  destAddr - Destination of the DMA transfer
14341  destSize - Size of the destination
14342  cellSize - Size of the cell
14343  Returns:
14344  None.
14345  Example:
14346  <code>
14347  // Add 10 bytes of data transfer to UART TX
14348  // 'handle' is a valid handle returned
14349  // by the SYS_DMA_ChannelAllocate function.
14350  MY_APP_OBJ myAppObj;
14351  uint8_t buf[10];
14352  void *srcAddr;
14353  void *destAddr;
14354  size_t srcSize;
14355  size_t destSize;
14356  size_t cellSize;
14357  srcAddr = (uint8_t *) buf;
14358  srcSize = 10;
14359  destAddr = (uin8_t*) &U2TXREG;
14360  destSize = 1;
14361  cellSize = 1;
14362  // User registers an event handler with system service. This is done once
14363  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14364  (uintptr_t)&myAppObj);
14365  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14366  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14367  {
14368  // Error handling here
14369  }
14370  // Event Processing Technique. Event is received when
14371  // the transfer is processed.
14372  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14373  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14374  {
14375  switch(event)
14376  {
14377  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14378  // This means the data was transferred.
14379  break;
14380  case SYS_DMA_TRANSFER_EVENT_ERROR:
14381  // Error handling here.
14382  break;
14383  default:
14384  break;
14385  }
14386  }
14387  </code>
14388  Remarks:
14389  For PIC32MZ series of devices, if the source/destination addresses are
14390  RAM memory addresses, the the source/destination buffers
14391  should be made coherent to avoid the cache coherency issues.
14392  For example:
14393  <code>
14394  uint8_t buffer[1024];
14395  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14396  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14397  </code>
14398 */
14399 
14400 void
14402  SYS_DMA_CHANNEL_HANDLE handle ,
14403  const void * srcAddr ,
14404  size_t srcSize ,
14405  const void * destAddr ,
14406  size_t destSize ,
14407  size_t cellSize ) ;
14408 //******************************************************************************
14409 /* Function:
14410  void SYS_DMA_ChannelTransferSet
14411  (
14412  SYS_DMA_CHANNEL_HANDLE handle,
14413  const void *srcAddr, size_t srcSize
14414  const void *destAddr, size_t destSize,
14415  size_t cellSize
14416  )
14417  Summary:
14418  Sets up a data transfer to a DMA channel.
14419  Description:
14420  This function sets up data transfer characteristics for a DMA channel. The
14421  The source and the destination addresses, source and destination lengths,
14422  The number of bytes transferred per cell event are set.
14423  This function does not enables the DMA channel. The channel has to be explicitly
14424  enabled to start the data transfer.
14425  The above functions could be used in situations where in the user intends to
14426  setup transfer parameters but do not intend to enable the channel immediately.
14427  For example to chain to DMA channels in a cyclic order where the channels remains
14428  disabled. The channel is enabled automatically by the DMA when the transfer trigger
14429  condition occurs.
14430  Precondition:
14431  DMA should have been initialized by calling SYS_DMA_Initialize.
14432  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14433  The function SYS_DMA_ChannelSetup must have been called to setup and
14434  enable the required features.
14435  Parameters:
14436  handle - Handle of the DMA channel as returned by the
14437  SYS_DMA_ChannelAllocate function.
14438  srcAddr - Source of the DMA transfer
14439  srcSize - Size of the source
14440  destAddr - Destination of the DMA transfer
14441  destSize - Size of the destination
14442  cellSize - Size of the cell
14443  Returns:
14444  None.
14445  Example:
14446  <code>
14447  // Set up 10 bytes of data transfer to UART TX
14448  // 'handle' is a valid handle returned
14449  // by the SYS_DMA_ChannelAllocate function.
14450  MY_APP_OBJ myAppObj;
14451  uint8_t buf[10];
14452  void *srcAddr;
14453  void *destAddr;
14454  size_t srcSize;
14455  size_t destSize;
14456  size_t cellSize;
14457  srcAddr = (uint8_t *) buf;
14458  srcSize = 10;
14459  destAddr = (uin8_t*) &U2TXREG;
14460  destSize = 1;
14461  cellSize = 1;
14462  // User registers an event handler with system service. This is done once
14463  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14464  (uintptr_t)&myAppObj);
14465  SYS_DMA_ChannelTransferSet(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14466  SYS_DMA_ChannelEnable(handle);
14467  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14468  {
14469  // Error handling here
14470  }
14471  // Event Processing Technique. Event is received when
14472  // the transfer is processed.
14473  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14474  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14475  {
14476  switch(event)
14477  {
14478  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14479  // This means the data was transferred.
14480  break;
14481  case SYS_DMA_TRANSFER_EVENT_ERROR:
14482  // Error handling here.
14483  break;
14484  default:
14485  break;
14486  }
14487  }
14488  </code>
14489  Remarks:
14490  For PIC32MZ series of devices, if the source/destination addresses are
14491  RAM memory addresses, the the source/destination buffers
14492  should be made coherent to avoid the cache coherency issues.
14493  For example:
14494  <code>
14495  uint8_t buffer[1024];
14496  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14497  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14498  </code>
14499 */
14500 
14501 void
14503  SYS_DMA_CHANNEL_HANDLE handle ,
14504  const void * srcAddr ,
14505  size_t srcSize ,
14506  const void * destAddr ,
14507  size_t destSize ,
14508  size_t cellSize ) ;
14509 //******************************************************************************
14510 /* Function:
14511  size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14512  Summary:
14513  Returns the number of bytes transferred from source.
14514  Description:
14515  When a data transfer request is submitted. At any time while the transmission
14516  is in progress the size of the amount of data transferred from source
14517  can be known by calling this function.
14518  Precondition:
14519  DMA should have been initialized by calling SYS_DMA_Initialize.
14520  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14521  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14522  SYS_DMA_ChannelTransferSet.
14523  Parameters:
14524  handle - A valid channel handle, returned from the system service's
14525  Allocate routine
14526  Returns:
14527  size_t - Returns the number of bytes transferred from the submitted size.
14528  Example:
14529  <code>
14530  // 'handle' is a valid handle returned
14531  // by the SYS_DMA_ChannelAllocate function.
14532  MY_APP_OBJ myAppObj;
14533  uint8_t buf[10];
14534  void *srcAddr;
14535  void *destAddr;
14536  size_t srcSize;
14537  size_t destSize;
14538  size_t cellSize;
14539  size_t transferredSize;
14540  srcAddr = (uint8_t *) buf;
14541  srcSize = 10;
14542  destAddr = (uin8_t*) &U2TXREG;
14543  destSize = 1;
14544  cellSize = 1;
14545  channelHandle = SYS_DMA_ChannelAllocate(channel);
14546  // User registers an event handler with system service. This is done once
14547  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14548  (uintptr_t)&myAppObj);
14549  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14550  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14551  {
14552  // Error handling here
14553  }
14554  // The data is being transferred after adding the transfer to the DMA channel.
14555  // The user can get to know dynamically the amount of data
14556  // transmitted from source by calling SYS_DMA_ChannelSourceTransferredSizeGet
14557  transferredSize = SYS_DMA_ChannelSourceTransferredSizeGet(channelHandle);
14558  </code>
14559  Remarks:
14560  None.
14561 */
14562 
14563 size_t
14565  SYS_DMA_CHANNEL_HANDLE handle ) ;
14566 //******************************************************************************
14567 /* Function:
14568  size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14569  Summary:
14570  Returns the number of bytes transferred to destination.
14571  Description:
14572  When a data transfer request is submitted. At any time while the transmission
14573  is in progress the size of the amount of data transferred to destination
14574  can be known by calling this function.
14575  Precondition:
14576  DMA should have been initialized by calling SYS_DMA_Initialize.
14577  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14578  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14579  SYS_DMA_ChannelTransferSet.
14580  Parameters:
14581  handle - A valid channel handle, returned from the system service's
14582  Allocate routine
14583  Returns:
14584  size_t - Returns the number of bytes received from the submitted size.
14585  Example:
14586  <code>
14587  // 'handle' is a valid handle returned
14588  // by the SYS_DMA_ChannelAllocate function.
14589  MY_APP_OBJ myAppObj;
14590  uint8_t buf[10];
14591  void *srcAddr;
14592  void *destAddr;
14593  size_t srcSize;
14594  size_t destSize;
14595  size_t cellSize;
14596  size_t transferredSize;
14597  srcAddr = (uin8_t*) &U2RXREG;
14598  srcSize = 1;
14599  destAddr = (uint8_t *) buf ;
14600  destSize = 10;
14601  cellSize = 1;
14602  channelHandle = SYS_DMA_ChannelAllocate(channel);
14603  // User registers an event handler with system service. This is done once
14604  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14605  (uintptr_t)&myAppObj);
14606  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14607  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14608  {
14609  // Error handling here
14610  }
14611  // The data is being transferred after adding the transfer to the DMA channel.
14612  // The user can get to know dynamically the amount of data
14613  // transmitted to destination by calling SYS_DMA_ChannelDestinationTransferredSizeGet
14614  transferredSize = SYS_DMA_ChannelDestinationTransferredSizeGet(channelHandle);
14615  </code>
14616  Remarks:
14617  None.
14618 */
14619 
14620 size_t
14622  SYS_DMA_CHANNEL_HANDLE handle ) ;
14623 //******************************************************************************
14624 /*
14625  Function:
14626  void SYS_DMA_ChannelTransferEventHandlerSet
14627  (
14628  SYS_DMA_CHANNEL_HANDLE handle,
14629  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler,
14630  const uintptr_t contextHandle
14631  )
14632  Summary:
14633  This function allows a DMA system service client to set an event handler.
14634  Description:
14635  This function allows a client to set an event handler. The client may want
14636  to receive transfer related events in cases when it uses non-blocking read and
14637  write functions. The event handler should be set before the client
14638  intends to perform operations that could generate events.
14639  This function accepts a contextHandle parameter. This parameter could be
14640  set by the client to contain (or point to) any client specific data object
14641  that should be associated with this DMA channel.
14642  Precondition:
14643  DMA should have been initialized by calling SYS_DMA_Initialize.
14644  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14645  Parameters:
14646  handle - A valid channel handle, returned from the system service's
14647  Allocate routine
14648  eventHandler - Pointer to the event handler function.
14649  contextHandle - Value identifying the context of the application/driver/middleware
14650  that registered the event handling function.
14651  Returns:
14652  None.
14653  Example:
14654  <code>
14655  // 'handle' is a valid handle returned
14656  // by the SYS_DMA_ChannelAllocate function.
14657  MY_APP_OBJ myAppObj;
14658  uint8_t buf[10];
14659  void *srcAddr;
14660  void *destAddr;
14661  size_t srcSize;
14662  size_t destSize;
14663  size_t cellSize;
14664  srcAddr = (uint8_t *) buf;
14665  srcSize = 10;
14666  destAddr = (uin8_t*) &U2TXREG;
14667  destSize = 1;
14668  cellSize = 1;
14669  channelHandle = SYS_DMA_ChannelAllocate(channel);
14670  // User registers an event handler with system service. This is done once
14671  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14672  (uintptr_t)&myAppObj);
14673  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14674  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14675  {
14676  // Error handling here
14677  }
14678  // Event Processing Technique. Event is received when
14679  // the transfer is processed.
14680  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14681  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14682  {
14683  switch(event)
14684  {
14685  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14686  // This means the data was transferred.
14687  break;
14688  case SYS_DMA_TRANSFER_EVENT_ERROR:
14689  // Error handling here.
14690  break;
14691  default:
14692  break;
14693  }
14694  }
14695  </code>
14696  Remarks:
14697  None.
14698  */
14699 
14700 void
14702  SYS_DMA_CHANNEL_HANDLE handle ,
14703  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler ,
14704  const uintptr_t contextHandle ) ;
14705 // *****************************************************************************
14706 /* Function:
14707  SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
14708  Summary:
14709  This function returns the error(if any) associated with the last client
14710  request.
14711  Description:
14712  This function returns the error(if any) associated with the last client
14713  request. If the service send a SYS_DMA_TRANSFER_EVENT_ERROR to the client,
14714  the client can call this function to know the error cause.
14715  The error status will be updated on every operation and should be read
14716  frequently (ideally immediately after the service operation has completed)
14717  to know the relevant error status.
14718  Precondition:
14719  The SYS_DMA_Initialize routine must have been called for the DMA sub system.
14720  SYS_DMA_ChannelAllocate must have been called to obtain a valid opened channel
14721  handle.
14722  Parameters:
14723  handle - Handle of the DMA channel as returned by the
14724  SYS_DMA_ChannelAllocate function.
14725  Returns:
14726  A SYS_DMA_ERROR type indicating last known error status.
14727  Example:
14728  <code>
14729  // 'handle' is a valid handle returned
14730  // by the SYS_DMA_ChannelAllocate function.
14731  // pDmaSrc, pDmaDst is the source,destination address
14732  // txferSrcSize, txferDesSize is the source,destination transfer size
14733  // cellSize is the cell size
14734  MY_APP_OBJ myAppObj;
14735  // Client registers an event handler with service. This is done once
14736  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14737  (uintptr_t)&myAppObj );
14738  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14739  DMA_TRIGGER_SOURCE_NONE);
14740  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14741  pDmaDst,txferDesSize,cellSize);
14742  SYS_DMA_ChannelForceStart(handle);
14743  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14744  {
14745  // Error handling here
14746  }
14747  // Event Processing Technique. Event is received when
14748  // the transfer is processed.
14749  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14750  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14751  {
14752  switch(event)
14753  {
14754  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14755  // This means the data was transferred.
14756  break;
14757  case SYS_DMA_TRANSFER_EVENT_ERROR:
14758  // Error handling here.
14759  if(SYS_DMA_ERROR_ADDRESS_ERROR == SYS_DMA_ChannelErrorGet(handle))
14760  {
14761  // There was an address error.
14762  // Do error handling here.
14763  }
14764  break;
14765  default:
14766  break;
14767  }
14768  }
14769  </code>
14770  Remarks:
14771  It is the client's responsibility to make sure that the error status is
14772  obtained frequently. The service will update the error status
14773  regardless of whether this has been examined by the client.
14774 */
14775 
14778  SYS_DMA_CHANNEL_HANDLE handle ) ;
14779 //******************************************************************************
14780 /* Function:
14781  void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
14782  Summary:
14783  Force start of transfer on the selected channel.
14784  Description:
14785  The function force start a DMA transfer to occur for the selected channel.
14786  Precondition:
14787  DMA should have been initialized by calling SYS_DMA_Initialize.
14788  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14789  The function SYS_DMA_ChannelSetup must have been called to setup and
14790  enable the required features.
14791  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14792  Parameters:
14793  handle - Handle of the DMA channel as returned by the
14794  SYS_DMA_ChannelAllocate function.
14795  Returns:
14796  None.
14797  Example:
14798  <code>
14799  // 'handle' is a valid handle returned
14800  // by the SYS_DMA_ChannelAllocate function.
14801  // pDmaSrc, pDmaDst is the source,destination address
14802  // txferSrcSize, txferDesSize is the source,destination transfer size
14803  // cellSize is the cell size
14804  MY_APP_OBJ myAppObj;
14805  // Client registers an event handler with service. This is done once
14806  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14807  (uintptr_t)&myAppObj );
14808  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14809  DMA_TRIGGER_SOURCE_NONE);
14810  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14811  pDmaDst,txferDesSize,cellSize);
14812  SYS_DMA_ChannelForceStart(handle);
14813  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14814  {
14815  // Error handling here
14816  }
14817  // Event Processing Technique. Event is received when
14818  // the transfer is processed.
14819  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14820  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14821  {
14822  switch(event)
14823  {
14824  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14825  // This means the data was transferred.
14826  break;
14827  case SYS_DMA_TRANSFER_EVENT_ERROR:
14828  // Error handling here.
14829  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14830  {
14831  // There was an address error.
14832  // Do error handling here.
14833  }
14834  break;
14835  default:
14836  break;
14837  }
14838  }
14839  </code>
14840  Remarks:
14841  This function must be used to start the DMA transfer when the channel has been
14842  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14843 */
14844 
14845 void
14847  SYS_DMA_CHANNEL_HANDLE handle ) ;
14848 //******************************************************************************
14849 /* Function:
14850  void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
14851  Summary:
14852  Force abort of transfer on the selected channel.
14853  Description:
14854  The function aborts a DMA transfer to occur for the selected channel.
14855  Precondition:
14856  DMA should have been initialized by calling SYS_DMA_Initialize.
14857  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14858  The function SYS_DMA_ChannelSetup must have been called to setup and
14859  enable the required features.
14860  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14861  Parameters:
14862  handle - Handle of the DMA channel as returned by the
14863  SYS_DMA_ChannelAllocate function.
14864  Returns:
14865  None.
14866  Example:
14867  <code>
14868  // 'handle' is a valid handle returned
14869  // by the SYS_DMA_ChannelAllocate function.
14870  // pDmaSrc, pDmaDst is the source,destination address
14871  // txferSrcSize, txferDesSize is the source,destination transfer size
14872  // cellSize is the cell size
14873  MY_APP_OBJ myAppObj;
14874  // Client registers an event handler with service. This is done once
14875  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14876  (uintptr_t)&myAppObj );
14877  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14878  DMA_TRIGGER_SOURCE_NONE);
14879  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14880  pDmaDst,txferDesSize,cellSize);
14881  SYS_DMA_ChannelForceStart(handle);
14882  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14883  {
14884  // Error handling here
14885  }
14886  ....
14887  ....
14888  // Client may need to abort a transfer
14889  SYS_DMA_ChannelForceAbort(handle);
14890  // Event Processing Technique. Event is received when
14891  // the transfer is processed.
14892  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14893  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14894  {
14895  switch(event)
14896  {
14897  case SYS_DMA_TRANSFER_EVENT_ABORT:
14898  // This means the data was transferred.
14899  break;
14900  case SYS_DMA_TRANSFER_EVENT_ERROR:
14901  // Error handling here.
14902  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14903  {
14904  // There was an address error.
14905  // Do error handling here.
14906  }
14907  break;
14908  default:
14909  break;
14910  }
14911  }
14912  </code>
14913  Remarks:
14914  This function must be used to abort the DMA transfer when the channel has been
14915  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14916  and SYS_DMA_ChannelAbortEventSet has not been called.
14917 */
14918 
14919 void
14921  SYS_DMA_CHANNEL_HANDLE handle ) ;
14922 //******************************************************************************
14923 /* Function:
14924  void SYS_DMA_ChannelAbortEventSet
14925  (
14926  SYS_DMA_CHANNEL_HANDLE handle,
14927  DMA_TRIGGER_SOURCE eventSrc
14928  )
14929  Summary:
14930  Sets an event source and enables cell transfer abort event for the same
14931  for the selected channel.
14932  Description:
14933  This functions enables a cell transfer abort event for the selected source
14934  event.
14935  Precondition:
14936  DMA should have been initialized by calling SYS_DMA_Initialize.
14937  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14938  The function SYS_DMA_ChannelSetup must have been called to setup and
14939  enable the required features.
14940  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14941  Parameters:
14942  handle - Handle of the DMA channel as returned by the
14943  SYS_DMA_ChannelAllocate function.
14944  eventSrc - The event causing the cell transfer abort
14945  Returns:
14946  None.
14947  Example:
14948  <code>
14949  // 'handle' is a valid handle returned
14950  // by the SYS_DMA_ChannelAllocate function.
14951  // pDmaSrc, pDmaDst is the source,destination address
14952  // txferSrcSize, txferDesSize is the source,destination transfer size
14953  // cellSize is the cell size
14954  MY_APP_OBJ myAppObj;
14955  // Client registers an event handler with service. This is done once
14956  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14957  (uintptr_t)&myAppObj );
14958  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14959  DMA_TRIGGER_SOURCE_NONE);
14960  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14961  pDmaDst,txferDesSize,cellSize);
14962  SYS_DMA_ChannelAbortEventSet(handle, DMA_TRIGGER_CTMU);
14963  SYS_DMA_ChannelForceStart(handle);
14964  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14965  {
14966  // Error handling here
14967  }
14968  // Event Processing Technique. Event is received when
14969  // the transfer is processed.
14970  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14971  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14972  {
14973  switch(event)
14974  {
14975  case SYS_DMA_TRANSFER_EVENT_ABORT:
14976  // This means the data was transferred.
14977  break;
14978  case SYS_DMA_TRANSFER_EVENT_ERROR:
14979  // Error handling here.
14980  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14981  {
14982  // There was an address error.
14983  // Do error handling here.
14984  }
14985  break;
14986  default:
14987  break;
14988  }
14989  }
14990  </code>
14991  Remarks:
14992  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE the
14993  current DMA transfer will be aborted. The behavior is a same as calling
14994  SYS_DMA_ChannelForceAbort.
14995 */
14996 
14997 void
14999  SYS_DMA_CHANNEL_HANDLE handle ,
15000  DMA_TRIGGER_SOURCE eventSrc ) ;
15001 //******************************************************************************
15002 /* Function:
15003  bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
15004  Summary:
15005  Returns the busy status of the specified DMA channel.
15006  Description:
15007  This function returns the busy status of the selected DMA channel
15008  Precondition:
15009  DMA should have been initialized by calling SYS_DMA_Initialize.
15010  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
15011  Parameters:
15012  handle - Handle of the DMA channel as returned by the
15013  SYS_DMA_ChannelAllocate function.
15014  Returns:
15015  bool - true, if the selected DMA channel is active or enabled
15016  - false, if the selected DMA channel is inactive or disabled
15017  Example:
15018  <code>
15019  bool busyStat;
15020  busyStat = SYS_DMA_ChannelGetBusy(handle);
15021  </code>
15022  Remarks:
15023  This feature may not be available on all devices. Refer to the specific device
15024  data sheet to determine availability.
15025 */
15026 
15027 bool
15029  SYS_DMA_CHANNEL_HANDLE handle ) ;
15030 //******************************************************************************
15031 /* Function:
15032  void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
15033  Summary:
15034  Suspend DMA operation on the specified DMA channel.
15035  Description:
15036  This function suspends the DMA operation on the DMA channel
15037  specified by the channel handle.
15038  Precondition:
15039  DMA should have been initialized by calling SYS_DMA_Initialize.
15040  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
15041  Parameters:
15042  handle - Handle of the DMA channel as returned by the
15043  SYS_DMA_ChannelAllocate function.
15044  Returns:
15045  None.
15046  Example:
15047  <code>
15048  SYS_DMA_ChannelSuspend(handle);
15049  </code>
15050  Remarks:
15051  This feature may not be available on all devices. Refer to the specific device
15052  data sheet to determine availability.
15053 */
15054 
15055 void
15057  SYS_DMA_CHANNEL_HANDLE handle ) ;
15058 //******************************************************************************
15059 /* Function:
15060  void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
15061  Summary:
15062  Resume DMA operation on the specified DMA channel.
15063  Description:
15064  This function resumes the DMA operation on the DMA channel
15065  specified by the channel handle.
15066  Precondition:
15067  DMA should have been initialized by calling SYS_DMA_Initialize.
15068  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
15069  Parameters:
15070  handle - Handle of the DMA channel as returned by the
15071  SYS_DMA_ChannelAllocate function.
15072  Returns:
15073  None.
15074  Example:
15075  <code>
15076  SYS_DMA_ChannelResume(handle);
15077  </code>
15078  Remarks:
15079  This feature may not be available on all devices. Refer to the specific device
15080  data sheet to determine availability.
15081 */
15082 
15083 void
15085  SYS_DMA_CHANNEL_HANDLE handle ) ;
15086 // *****************************************************************************
15087 // *****************************************************************************
15088 // Section: Global DMA Management Functions
15089 // *****************************************************************************
15090 // *****************************************************************************
15091 //******************************************************************************
15092 /* Function:
15093  void SYS_DMA_Suspend(void)
15094  Summary:
15095  Suspend DMA transfers.
15096  Description:
15097  This function suspends DMA transfers to allow CPU uninterrupted access
15098  to data bus
15099  Precondition:
15100  DMA should have been initialized by calling SYS_DMA_Initialize.
15101  Parameters:
15102  None.
15103  Returns:
15104  None.
15105  Example:
15106  <code>
15107  SYS_DMA_Suspend();
15108  </code>
15109  Remarks:
15110  None
15111 */
15112 
15113 void
15114  SYS_DMA_Suspend ( void ) ;
15115 //******************************************************************************
15116 /* Function:
15117  void SYS_DMA_Resume(void)
15118  Summary:
15119  Resume DMA operations.
15120  Description:
15121  This function disables DMA suspend. It resumes the DMA operation suspended
15122  by calling SYS_DMA_Suspend. The DMA operates normally.
15123  Precondition:
15124  DMA should have been initialized by calling SYS_DMA_Initialize.
15125  Parameters:
15126  None.
15127  Returns:
15128  None.
15129  Example:
15130  <code>
15131  SYS_DMA_Resume();
15132  </code>
15133  Remarks:
15134  None
15135 */
15136 
15137 void
15138  SYS_DMA_Resume ( void ) ;
15139 //******************************************************************************
15140 /* Function:
15141  bool SYS_DMA_IsBusy(void)
15142  Summary:
15143  Returns the busy status of the DMA module.
15144  Description:
15145  This function returns the busy status of the DMA module
15146  Precondition:
15147  DMA should have been initialized by calling SYS_DMA_Initialize.
15148  Parameters:
15149  None.
15150  Returns:
15151  Boolean
15152  - true - The DMA module is active
15153  - false - The DMA module is inactive and disabled
15154  <code>
15155  bool busyStat;
15156  busyStat = SYS_DMA_IsBusy();
15157  </code>
15158  Remarks:
15159  This feature may not be available on all devices. Refer to the specific device
15160  data sheet to determine availability.
15161 */
15162 
15163 bool
15164  SYS_DMA_IsBusy ( void ) ;
15165 // *****************************************************************************
15166 // *****************************************************************************
15167 // Section: Deprecated functions
15168 // *****************************************************************************
15169 // *****************************************************************************
15170 //*******************************************************************************
15171 /* Function:
15172  void SYS_DMA_TasksISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
15173  Summary:
15174  This function is deprecated. Use SYS_DMA_Tasks function.
15175  */
15176 
15177 void
15178  SYS_DMA_Tasks (
15179  SYS_MODULE_OBJ object ,
15180  DMA_CHANNEL activeChannel ) ;
15181 //*****************************************************************************
15182 /* Function:
15183  void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
15184  Summary:
15185  This function is deprecated. Use SYS_DMA_Tasks function.
15186  */
15187 
15188 void
15190  SYS_MODULE_OBJ object ) ;
15191 //*******************************************************************************
15192 /* Function:
15193  void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
15194  Summary:
15195  This function is deprecated. Use SYS_DMA_Tasks function.
15196  */
15197 
15198 void
15200  SYS_MODULE_OBJ object ,
15201  DMA_CHANNEL activeChannel ) ;
15202  // #ifndef _SYS_DMA_H
15203 /*******************************************************************************
15204  End of File
15205 */
15206 
15207 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h*/
15208 /* CLOSE_FILE Include File */
15209 
15210 // DOM-IGNORE-BEGIN
15211 // DOM-IGNORE-END
15212 // *****************************************************************************
15213 // *****************************************************************************
15214 // Section: Data Types
15215 // *****************************************************************************
15216 // *****************************************************************************
15217 // *****************************************************************************
15218 /* Driver USART Module Index
15219  Summary:
15220  USART driver index definitions
15221  Description:
15222  These constants provide USART driver index definitions.
15223  Remarks:
15224  These constants should be used in place of hard-coded numeric literals.
15225  These values should be passed into the DRV_USART_Initialize and
15226  DRV_USART_Open routines to identify the driver instance in use.
15227 */
15228 #define DRV_USART_INDEX_0 0
15229 #define DRV_USART_INDEX_1 1
15230 #define DRV_USART_INDEX_2 2
15231 #define DRV_USART_INDEX_3 3
15232 #define DRV_USART_INDEX_4 4
15233 #define DRV_USART_INDEX_5 5
15234 // *****************************************************************************
15235 /* USART Driver Module Count
15236  Summary:
15237  Number of valid USART drivers
15238  Description:
15239  This constant identifies the maximum number of USART Driver instances that
15240  should be defined in the system. Defining more instances than this
15241  constant will waste RAM memory space.
15242  This constant can also be used by the system and application to identify the
15243  number of USART instances on this microcontroller.
15244  Remarks:
15245  This value is part-specific.
15246 */
15247 #define DRV_USART_COUNT USART_NUMBER_OF_MODULES
15248 // *****************************************************************************
15249 /* USART Driver Write Error
15250  Summary:
15251  USART Driver Write Error.
15252  Description:
15253  This constant is returned by DRV_USART_Write() function when an error
15254  occurs.
15255  Remarks:
15256  None.
15257 */
15258 #define DRV_USART_WRITE_ERROR ( ( uint32_t ) ( - 1 ) )
15259 // *****************************************************************************
15260 /* USART Driver Read Error
15261  Summary:
15262  USART Driver Read Error.
15263  Description:
15264  This constant is returned by DRV_USART_Read() function when an error
15265  occurs.
15266  Remarks:
15267  None.
15268 */
15269 #define DRV_USART_READ_ERROR ( ( uint32_t ) ( - 1 ) )
15270 // *****************************************************************************
15271 /* USART Driver Buffer Handle
15272  Summary:
15273  Handle identifying a read or write buffer passed to the driver.
15274  Description:
15275  A buffer handle value is returned by a call to the DRV_USART_BufferAddRead
15276  or DRV_USART_BufferAddWrite functions. This handle is associated with the
15277  buffer passed into the function and it allows the application to track the
15278  completion of the data from (or into) that buffer. The buffer handle value
15279  returned from the "buffer add" function is returned back to the client
15280  by the "event handler callback" function registered with the driver.
15281  The buffer handle assigned to a client request expires when the client has
15282  been notified of the completion of the buffer transfer (after event handler
15283  function that notifies the client returns) or after the buffer has been
15284  retired by the driver if no event handler callback was set.
15285  Remarks:
15286  None
15287 */
15288 
15289 typedef
15290 uintptr_t
15292 // *****************************************************************************
15293 /* USART Driver Invalid Buffer Handle
15294  Summary:
15295  Definition of an invalid buffer handle.
15296  Description:
15297  This is the definition of an invalid buffer handle. An invalid buffer handle
15298  is returned by DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite
15299  functions if the buffer add request was not successful.
15300  Remarks:
15301  None
15302 */
15303 #define DRV_USART_BUFFER_HANDLE_INVALID ( ( DRV_USART_BUFFER_HANDLE ) ( - 1 ) )
15304 // *****************************************************************************
15305 /* USART Modes of Operation
15306  Summary:
15307  Identifies the modes of the operation of the USART module
15308  Description:
15309  This data type identifies the modes of the operation of the USART module.
15310  Remarks:
15311  Not all modes are available on all devices. Refer to the specific device data
15312  sheet to determine availability.
15313 */
15314 
15315 typedef
15316  enum
15317  {
15318  /* USART works in IRDA mode */
15320  /* This is the normal point to point communication mode where the USART
15321  communicates directly with another USART by connecting it's Transmit signal
15322  to the external USART's Receiver signal and vice versa. An external
15323  transceiver may be connected to obtain RS-232 signal levels. This type of
15324  connection is typically full duplex. */
15326  /* This is a multi-point bus mode where the USART can communicate with
15327  many other USARTS on a bus using an address-based protocol such as RS-485.
15328  This mode is typically half duplex and the physical layer may require a
15329  transceiver. In this mode every USART on the bus is assigned an address and
15330  the number of data bits is 9 bits */
15332  /* Loopback mode internally connects the Transmit signal to the Receiver
15333  signal, looping data transmission back into this USART's own input. It is
15334  useful primarily as a test mode. */
15337 // *****************************************************************************
15338 /* USART Driver Buffer Events
15339  Summary
15340  Identifies the possible events that can result from a buffer add request.
15341  Description
15342  This enumeration identifies the possible events that can result from a
15343  buffer add request caused by the client calling either the
15344  DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite functions.
15345  Remarks:
15346  One of these values is passed in the "event" parameter of the event
15347  handling callback function that the client registered with the driver by
15348  calling the DRV_USART_BufferEventHandlerSet function when a buffer
15349  transfer request is completed.
15350 */
15351 
15352 typedef
15353  enum
15354  {
15355  /* All data from or to the buffer was transferred successfully. */
15357  /* There was an error while processing the buffer transfer request. */
15359  /* Data transfer aborted (Applicable in DMA mode) */
15362 // *****************************************************************************
15363 /* USART Driver Buffer Result
15364  Summary
15365  Identifies the possible result of the buffer processing.
15366  Description
15367  This enumeration identifies the possible result of the buffer processing.
15368 
15369  Remarks:
15370  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED is the state of the buffer which
15371  is in the free buffer pool.
15372 */
15373 
15374 typedef
15375  enum
15376  {
15377  /* Buffer handle is not valid*/
15379  /* Buffer handle has expired. */
15381  /* Buffer is removed from the queue succesfully*/
15383  /* Buffer removal failed because of unable to acquire the mutex
15384  * This is applicable in RTOS mode only */
15387 // *****************************************************************************
15388 /* USART Driver Buffer Event Handler Function Pointer
15389  Summary
15390  Pointer to a USART Driver Buffer Event handler function
15391  Description
15392  This data type defines the required function signature for the USART driver
15393  buffer event handling callback function. A client must register a pointer
15394  to a buffer event handling function whose function signature (parameter
15395  and return value types) match the types specified by this function pointer
15396  in order to receive buffer related event calls back from the driver.
15397  The parameters and return values and are described here and
15398  a partial example implementation is provided.
15399  Parameters:
15400  event - Identifies the type of event
15401  bufferHandle - Handle identifying the buffer to which the vent relates
15402  context - Value identifying the context of the application that registered
15403  the event handling function.
15404  Returns:
15405  None.
15406  Example:
15407  <code>
15408  void APP_MyBufferEventHandler( DRV_USART_BUFFER_EVENT event,
15409  DRV_USART_BUFFER_HANDLE bufferHandle,
15410  uintptr_t context )
15411  {
15412  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
15413  switch(event)
15414  {
15415  case DRV_USART_BUFFER_EVENT_COMPLETE:
15416  // Handle the completed buffer.
15417  break;
15418  case DRV_USART_BUFFER_EVENT_ERROR:
15419  default:
15420  // Handle error.
15421  break;
15422  }
15423  }
15424  </code>
15425  Remarks:
15426  If the event is DRV_USART_BUFFER_EVENT_COMPLETE, it means that the data was
15427  transferred successfully.
15428  If the event is DRV_USART_BUFFER_EVENT_ERROR, it means that the data was not
15429  transferred successfully. The DRV_USART_ErrorGet function can be called to
15430  know the error. The DRV_USART_BufferCompletedBytesGet function can be
15431  called to find out how many bytes were processed.
15432  The bufferHandle parameter contains the buffer handle of the buffer that
15433  associated with the event.
15434  The context parameter contains the a handle to the client context,
15435  provided at the time the event handling function was registered using the
15436  DRV_USART_BufferEventHandlerSet function. This context handle value is
15437  passed back to the client as the "context" parameter. It can be any value
15438  necessary to identify the client context or instance (such as a pointer to
15439  the client's data) instance of the client that made the buffer add request.
15440  The event handler function executes in the driver peripheral's interrupt
15441  context when the driver is configured for interrupt mode operation. It is
15442  recommended of the application to not perform process intensive or blocking
15443  operations with in this function.
15444  The DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite functions can
15445  be called in the event handler to add a buffer to the driver queue. These
15446  functions can only be called to add buffers to the driver whose event
15447  handler is running. For example, buffers cannot be added USART2 driver in
15448  USART1 driver event handler.
15449 */
15450 
15451 typedef
15453 DRV_USART_BUFFER_HANDLE bufferHandle ,
15454 uintptr_t context ) ;
15455 // *****************************************************************************
15456 /* USART Driver Byte Event Handler Function Pointer
15457  Summary
15458  Pointer to a USART Driver Byte Event handler function
15459  Description
15460  This data type defines the required function signature for the USART driver
15461  byte event handling callback function. A client must register a pointer to a
15462  byte event handling function whose function signature (parameter and return
15463  value types) match the types specified by this function pointer in order to
15464  receive byte related event calls back from the driver.
15465  Parameters:
15466  index - Identifier for the instance
15467  Returns:
15468  None.
15469  Example:
15470  <code>
15471  void APP_MyUsartTxEventHandler(void)
15472  {
15473  // Handle the transmit byte event
15474  }
15475  </code>
15476  Remarks:
15477  The event handler function executes in the driver peripheral's interrupt
15478  context when the driver is configured for interrupt mode operation. It is
15479  recommended that the application not perform process intensive or blocking
15480  operations with in this function.
15481 */
15482 
15483 typedef
15484 void ( * DRV_USART_BYTE_EVENT_HANDLER ) ( const SYS_MODULE_INDEX index ) ;
15485 // *****************************************************************************
15486 /* USART Handshake Modes
15487  Summary:
15488  Identifies the handshaking modes supported by the USART driver.
15489  Description:
15490  This data type identifies the handshaking modes supported by the USART
15491  driver.
15492  Remarks:
15493  Not all modes are available on all devices. Refer to the specific device data
15494  sheet to determine availability.
15495 */
15496 
15497 typedef
15498  enum
15499  {
15500  /* Handshaking occurs in Flow Control Mode */
15501  DRV_USART_HANDSHAKE_FLOWCONTROL = /*DOM-IGNORE-BEGIN*/
15502  USART_HANDSHAKE_MODE_FLOW_CONTROL /*DOM-IGNORE-END*/
15503  ,
15504  /* Handshaking occurs in Simplex Mode */
15505  DRV_USART_HANDSHAKE_SIMPLEX = /*DOM-IGNORE-BEGIN*/
15506  USART_HANDSHAKE_MODE_SIMPLEX /*DOM-IGNORE-END*/
15507  ,
15508  /* No Handshaking */
15509  DRV_USART_HANDSHAKE_NONE = /*DOM-IGNORE-BEGIN*/
15510  2 /*DOM-IGNORE-END*/
15512 // *****************************************************************************
15513 /* USART Baud Set Result
15514  Summary:
15515  Identifies the results of the baud set function.
15516  Description:
15517  This data type identifies the results of the DRV_USART_BaudSet function.
15518  Remarks:
15519  None.
15520 */
15521 
15522 typedef
15523  enum
15524  {
15525  /* The driver was not able to change the baud */
15526  DRV_USART_BAUD_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15527  - 1 /*DOM-IGNORE-END*/
15528  ,
15529  /* The driver was able to change the baud successfully */
15532 // *****************************************************************************
15533 /* USART Line Control Set Result
15534  Summary:
15535  Identifies the results of the baud set function.
15536  Description:
15537  This data type identifies the results of the DRV_USART_LineControlSet
15538  function.
15539  Remarks:
15540  None.
15541 */
15542 
15543 typedef
15544  enum
15545  {
15546  /* The driver was not able to change the Line Control */
15547  DRV_USART_LINE_CONTROL_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15548  - 1 /*DOM-IGNORE-END*/
15549  ,
15550  /* The driver was able to change the Line Control successfully */
15553 // *****************************************************************************
15554 /* USART Line Control Modes
15555  Summary:
15556  Identifies the line control modes supported by the USART driver.
15557  Description:
15558  This data type identifies the line control modes supported by the USART
15559  driver. Line control modes define the number of data bits, parity mode, and
15560  the number of stop bits in a USART transmit and receive frames.
15561  Remarks:
15562  The abbreviations used in the labels for the values of this enumeration
15563  follow the format <data><parity><stop>, where:
15564  <data> is the number of data bits
15565  <parity> is either "NONE" (for no parity), "EVEN" for 1 parity bit
15566  added to obtain an even number of bits, or "ODD" for one bit
15567  added to obtain an odd number of bits.
15568  <stop> is the number of Stop bits
15569 */
15570 
15571 typedef
15572  enum
15573  {
15574  /* 8 data bits, no parity bit, 1 stop bit */
15575  DRV_USART_LINE_CONTROL_8NONE1 = /*DOM-IGNORE-BEGIN*/
15576  USART_8N1 /* DOM-IGNORE-END*/
15577  ,
15578  /* 9 data bits, no parity bit, 1 stop bit */
15579  DRV_USART_LINE_CONTROL_9NONE1 = /*DOM-IGNORE-BEGIN*/
15580  USART_9N1 /* DOM-IGNORE-END*/
15581  ,
15582  /* 8 data bits, 1 bit for even parity, 1 stop bit */
15583  DRV_USART_LINE_CONTROL_8EVEN1 = /*DOM-IGNORE-BEGIN*/
15584  USART_8E1 /* DOM-IGNORE-END*/
15585  ,
15586  /* 8 data bits, 1 bit for even parity, 2 stop bits */
15587  DRV_USART_LINE_CONTROL_8EVEN2 = /*DOM-IGNORE-BEGIN*/
15588  USART_8E2 /* DOM-IGNORE-END*/
15589  ,
15590  /* 8 data bits, 1 bit for odd parity, 1 stop bit */
15591  DRV_USART_LINE_CONTROL_8ODD1 = /*DOM-IGNORE-BEGIN*/
15592  USART_8O1 /* DOM-IGNORE-END*/
15593  ,
15594  /* 8 data bits, 1 bit for odd parity, 2 stop bits */
15595  DRV_USART_LINE_CONTROL_8ODD2 = /*DOM-IGNORE-BEGIN*/
15596  USART_8O2 /* DOM-IGNORE-END*/
15597  ,
15598  /* 8 data bits, no parity bit, 2 stop bit */
15599  DRV_USART_LINE_CONTROL_8NONE2 = /*DOM-IGNORE-BEGIN*/
15600  USART_8N2 /* DOM-IGNORE-END*/
15601  ,
15602  /* 9 data bits, no parity bit, 2 stop bit */
15603  DRV_USART_LINE_CONTROL_9NONE2 = /*DOM-IGNORE-BEGIN*/
15604  USART_9N2 /* DOM-IGNORE-END*/
15606 // *****************************************************************************
15607 /* USART Initialization flags
15608  Summary:
15609  Flags identifying features that can be enabled when the driver is
15610  initialized.
15611  Description:
15612  This enumeration defines flags identifying features that can be enabled
15613  when the driver is initialized.
15614  Remarks:
15615  These flags can be logically ORed together. They are passed into the
15616  DRV_USART_Initialize function through the "flags" member of the
15617  DRV_USART_INIT structure.
15618 */
15619 
15620 typedef
15621  enum
15622  {
15623  /* Use this if no flags need to be set */
15624  DRV_USART_INIT_FLAG_NONE = /* DOM-IGNORE-BEGIN */
15625  0 /*DOM-IGNORE-END*/
15626  ,
15627  /* Flag to enable "wake on start" operation. If supported and enabled,
15628  this feature will allow the USART to wake-up the device when a
15629  Start bit is received. This option should be selected only when the
15630  device is to placed in Sleep mode. Note that enabling this bit will
15631  also cause the first received character to be lost. Refer to the specific
15632  device data sheet for more information. */
15634  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15635  ,
15636  /* Flag to enable auto baud detection. If supported and enabled, this
15637  feature will allow the USART to automatically detect the baud rate in
15638  use. */
15639  DRV_USART_INIT_FLAG_AUTO_BAUD/*DOM-IGNORE-BEGIN*/
15640  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15641  ,
15642  /* Flag to enable stop in idle. If supported and enabled , this
15643  feature will allow the USART to stop when the CPU enters Idle
15644  mode */
15646  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15648 // *****************************************************************************
15649 /* Operation Mode Initialization Data
15650  Summary:
15651  Defines the initialization data required for different operation modes of
15652  USART.
15653  Description:
15654  This data type defines the initialization data required for different
15655  operation modes of the USART.
15656  Remarks:
15657  None
15658 */
15659 
15660 typedef
15661  union
15662  {
15663  /* Initialization for Addressed mode */
15664  struct
15665  {
15666  /* Address of the device. */
15667  uint8_t address ;
15668  } AddressedModeInit ;
15670 // *****************************************************************************
15671 /* USART Driver Errors.
15672  Summary:
15673  Defines the possible errors that can occur during driver operation.
15674  Description:
15675  This data type defines the possible errors that can occur when occur during
15676  USART driver operation. These values are returned by DRV_USART_ErrorGet
15677  function.
15678  Remarks:
15679  None
15680 */
15681 
15682 typedef
15683  enum
15684  {
15685  /* There was no error */
15687  /*DOM-IGNORE-BEGIN*/
15688  = USART_ERROR_NONE /*DOM-IGNORE-END*/
15689  ,
15690  /* This indicates that a parity error has occurred */
15692  /*DOM-IGNORE-BEGIN*/
15693  = USART_ERROR_PARITY /*DOM-IGNORE-END*/
15694  ,
15695  /* This indicates that a framing error has occurred */
15697  /*DOM-IGNORE-BEGIN*/
15698  = USART_ERROR_FRAMING /*DOM-IGNORE-END*/
15699  ,
15700  /* This indicates a receiver overflow has occurred */
15702  /*DOM-IGNORE-BEGIN*/
15703  = USART_ERROR_RECEIVER_OVERRUN /*DOM-IGNORE-END*/
15704  ,
15705  /* Channel address error (Applicable in DMA mode) */
15706  DRV_USART_ERROR_ADDRESS /*DOM-IGNORE-BEGIN*/
15707  = ( 1 << 4 ) /* DOM-IGNORE-END*/
15708  } DRV_USART_ERROR ;
15709 // *****************************************************************************
15710 /* USART Client-Specific Driver Status
15711  Summary:
15712  Defines the client-specific status of the USART driver.
15713  Description:
15714  This enumeration defines the client-specific status codes of the USART
15715  driver.
15716  Remarks:
15717  Returned by the DRV_USART_ClientStatus function.
15718 */
15719 
15720 typedef
15721  enum
15722  {
15723  /* An error has occurred.*/
15725  /* The driver is closed, no operations for this client are ongoing,
15726  and/or the given handle is invalid. */
15728  /* The driver is currently busy and cannot start additional operations. */
15730  /* The module is running and ready for additional operations */
15733 // *****************************************************************************
15734 /* USART Driver Transfer Flags
15735  Summary
15736  Specifies the status of the receive or transmit
15737  Description
15738  This type specifies the status of the receive or transmit operation.
15739  Remarks:
15740  More than one of these values may be OR'd together to create a complete
15741  status value. To test a value of this type, the bit of interest must be
15742  ANDed with the value and checked to see if the result is non-zero.
15743 */
15744 
15745 typedef
15746  enum
15747  {
15748  /* Indicates that at least one byte of Data has been received */
15750  /*DOM-IGNORE-BEGIN*/
15751  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15752  ,
15753  /* Indicates that the core driver receiver buffer is empty */
15755  /*DOM-IGNORE-BEGIN*/
15756  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15757  ,
15758  /* Indicates that the core driver transmitter buffer is full */
15760  /*DOM-IGNORE-BEGIN*/
15761  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15762  ,
15763  /* Indicates that the core driver transmitter buffer is empty */
15765  /*DOM-IGNORE-BEGIN*/
15766  = ( 1 << 3 ) /*DOM-IGNORE-END*/
15768 // *****************************************************************************
15769 /* USART Driver Initialization Data
15770  Summary:
15771  Defines the data required to initialize or reinitialize the USART driver
15772  Description:
15773  This data type defines the data required to initialize or reinitialize the
15774  USART driver. If the driver is built statically, the members of this data
15775  structure are statically over-ridden by static override definitions in the
15776  system_config.h file.
15777  Remarks:
15778  None.
15779 */
15780 
15781 typedef
15782  struct
15783  {
15784  /* System module initialization data */
15785  SYS_MODULE_INIT moduleInit ;
15786  /* Identifies USART hardware module (PLIB-level) ID. For a static build of
15787  the driver, this is overridden by DRV_USART_MODULE_ID macro in the
15788  system_config.h header file. */
15789  USART_MODULE_ID usartID ;
15790  /* Identifies the Operation mode of the USART driver. For a static build of
15791  the driver, this is overridden by DRV_USART_MODE_SELECT macro in the
15792  system_config.h header file. */
15794  /* Data required by the operation mode of the driver. For a static build of
15795  the driver, this is overridden by DRV_USART_MODE_DATA macro in the
15796  system_config.h header file. */
15798  /* Flags to enable specific features. Refer to the
15799  description of DRV_USART_INIT_FLAGS for more details. For a static build
15800  of the driver, this is overridden by DRV_USART_FLAGS macro in the
15801  system_config.h header file. */
15802  DRV_USART_INIT_FLAGS flags ;
15803  /* USART module Baud Rate Generator Clock. This typically
15804  the peripheral bus clock frequency. For a static build of the driver,
15805  this is overridden by DRV_USART_BRG_CLOCK macro in the system_config.h
15806  header file. */
15807  uint32_t brgClock ;
15808  /* The initial USART line control settings. For a static build of the driver
15809  this is overridden by the DRV_USART_LINE_CONTROL_SET macro in the
15810  system_config.h header file. */
15811  DRV_USART_LINE_CONTROL lineControl ;
15812  /* Baud Rate value to be used, if not using auto baud. For a static build of
15813  the driver, this is overridden by the DRV_USART_BAUD macro in the
15814  system_config.h header file. */
15815  uint32_t baud ;
15816  /* Handshaking mode. For a static build of the driver, this is overridden by
15817  the DRV_USART_HANDSHAKE_SET macro in the system_config.h header file. */
15818  DRV_USART_HANDSHAKE handshake ;
15819  /* Lines enabled for the USART operation. For a static build of the driver,
15820  this is overridden by the DRV_USART_LINES_ENABLE macro in
15821  the system_config.h header file.
15822  For PPS parts, pin selection in ports overrides this. */
15823  USART_OPERATION_MODE linesEnable ;
15824  /* Interrupt source ID for the transmitter interrupt. For a static build of
15825  the driver, this is overridden by the DRV_USART_TRANSMIT_INTERRUPT_SOURCE
15826  macro in the system_config.h header. */
15827  INT_SOURCE interruptTransmit ;
15828  /* Interrupt source ID for the receiver interrupt. For a static build of
15829  the driver, this is overridden by the DRV_USART_RECEIVE_INTERRUPT_SOURCE
15830  macro in the system_config.h header. */
15831  INT_SOURCE interruptReceive ;
15832  /* Interrupt source ID for the error Interrupt. For a static build of the
15833  driver, this is overridden by the DRV_USART_ERROR_INTERRUPT_SOURCE macro
15834  in the system_config.h header. */
15835  INT_SOURCE interruptError ;
15836  /* This is the receive buffer queue size. This is the maximum
15837  number of read requests that driver will queue. For a
15838  static build of the driver, this is overridden by the
15839  DRV_USART_RECEIVE_QUEUE_SIZE macro in system_config.h */
15840  unsigned int queueSizeReceive ;
15841  /* This is the transmit buffer queue size. This is the maximum
15842  number of write requests that driver will queue. For a
15843  static build of the driver, this is overridden by the
15844  DRV_USART_TRANSMIT_QUEUE_SIZE macro in system_config.h */
15845  unsigned int queueSizeTransmit ;
15846  /* This is the USART transmit DMA channel.
15847  For a static build of the driver, this is overridden by the
15848  DRV_USART_XMIT_DMA_CH_IDXn macro in system_config.h */
15849  DMA_CHANNEL dmaChannelTransmit ;
15850  /* This is the USART receive DMA channel.
15851  For a static build of the driver, this is overridden by the
15852  DRV_USART_RCV_DMA_CH_IDXn macro in system_config.h */
15853  DMA_CHANNEL dmaChannelReceive ;
15854  /* This is the USART transmit DMA channel interrupt.
15855  For a static build of the driver, this is overridden by the
15856  DRV_USART_XMIT_DMA_INT_SRC_IDXn macro in system_config.h */
15857  INT_SOURCE dmaInterruptTransmit ;
15858  /* This is the USART receive DMA channel interrupt.
15859  For a static build of the driver, this is overridden by the
15860  DRV_USART_RCV_DMA_INT_SRC_IDXn macro in system_config.h */
15861  INT_SOURCE dmaInterruptReceive ;
15862  } DRV_USART_INIT ;
15863 //DOM-IGNORE-BEGIN
15864 //DOM-IGNORE-END
15865  // #ifndef _DRV_USART_DEFINITIONS_H
15866 /*******************************************************************************
15867  End of File
15868 */
15869 
15870 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h*/
15871 /* CLOSE_FILE Include File */
15872 
15873 // DOM-IGNORE-BEGIN
15874 // DOM-IGNORE-END
15875 // *****************************************************************************
15876 // *****************************************************************************
15877 // Section: USART Driver Module Interface Routines
15878 // *****************************************************************************
15879 // *****************************************************************************
15880 // *****************************************************************************
15881 /* Function:
15882  SYS_MODULE_OBJ DRV_USART_Initialize
15883  (
15884  const SYS_MODULE_INDEX index,
15885  const SYS_MODULE_INIT * const init
15886  )
15887  Summary:
15888  Initializes the USART instance for the specified driver index.
15889  <p><b>Implementation:</b> Static/Dynamic</p>
15890  Description:
15891  This routine initializes the USART driver instance for the specified driver
15892  index, making it ready for clients to open and use it. The initialization
15893  data is specified by the init parameter. The initialization may fail if the
15894  number of driver objects allocated are insufficient or if the specified
15895  driver instance is already initialized. The driver instance index is
15896  independent of the USART module ID. For example, driver instance 0 can be
15897  assigned to USART2. If the driver is built statically, then some of the
15898  initialization parameters are overridden by configuration macros. Refer to
15899  the description of the DRV_USART_INIT data structure for more details on
15900  which members on this data structure are overridden.
15901  Precondition:
15902  None.
15903  Parameters:
15904  index - Identifier for the instance to be initialized
15905  init - Pointer to a data structure containing any data necessary to
15906  initialize the driver.
15907  Returns:
15908  If successful, returns a valid handle to a driver instance object.
15909  Otherwise, returns SYS_MODULE_OBJ_INVALID.
15910  Example:
15911  <code>
15912  // The following code snippet shows an example USART driver initialization.
15913  // The driver is initialized for normal mode and a baud of 300. The
15914  // receive queue size is set to 2 and transmit queue size is set to 3.
15915  DRV_USART_INIT usartInit;
15916  SYS_MODULE_OBJ objectHandle;
15917  usartInit.baud = 300;
15918  usartInit.mode = DRV_USART_OPERATION_MODE_NORMAL;
15919  usartInit.flags = DRV_USART_INIT_FLAG_NONE;
15920  usartInit.usartID = USART_ID_2;
15921  usartInit.brgClock = 80000000;
15922  usartInit.handshake = DRV_USART_HANDSHAKE_NONE;
15923  usartInit.lineControl = DRV_USART_LINE_CONTROL_8NONE1;
15924  usartInit.interruptError = INT_SOURCE_USART_2_ERROR;
15925  usartInit.interruptReceive = INT_SOURCE_USART_2_RECEIVE;
15926  usartInit.queueSizeReceive = 2;
15927  usartInit.queueSizeTransmit = 3;
15928  usartInit.interruptTransmit = INT_SOURCE_USART_2_TRANSMIT;
15929  usartInit.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
15930  objectHandle = DRV_USART_Initialize(DRV_USART_INDEX_1, (SYS_MODULE_INIT*)&usartInitData);
15931  if (SYS_MODULE_OBJ_INVALID == objectHandle)
15932  {
15933  // Handle error
15934  }
15935  </code>
15936  Remarks:
15937  This routine must be called before any other USART routine is called.
15938  This routine should only be called once during system initialization
15939  unless DRV_USART_Deinitialize is called to deinitialize the driver
15940  instance. This routine will NEVER block for hardware access.
15941 */
15942 
15943 SYS_MODULE_OBJ
15945  const SYS_MODULE_INDEX index ,
15946  const SYS_MODULE_INIT * const init ) ;
15947 // *****************************************************************************
15948 /* Function:
15949  void DRV_USART_Deinitialize( SYS_MODULE_OBJ object )
15950  Summary:
15951  Deinitializes the specified instance of the USART driver module.
15952  <p><b>Implementation:</b> Static/Dynamic</p>
15953  Description:
15954  Deinitializes the specified instance of the USART driver module, disabling
15955  its operation (and any hardware). Invalidates all the internal data.
15956  Precondition:
15957  Function DRV_USART_Initialize should have been called before calling this
15958  function.
15959  Parameters:
15960  object - Driver object handle, returned from the
15961  DRV_USART_Initialize routine
15962  Returns:
15963  None.
15964  Example:
15965  <code>
15966  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15967  SYS_STATUS status;
15968  DRV_USART_Deinitialize(object);
15969  status = DRV_USART_Status(object);
15970  if (SYS_MODULE_DEINITIALIZED != status)
15971  {
15972  // Check again later if you need to know
15973  // when the driver is deinitialized.
15974  }
15975  </code>
15976  Remarks:
15977  Once the Initialize operation has been called, the Deinitialize operation
15978  must be called before the Initialize operation can be called again. This
15979  routine will NEVER block waiting for hardware.
15980 */
15981 
15982 void
15984  SYS_MODULE_OBJ object ) ;
15985 // *****************************************************************************
15986 /* Function:
15987  SYS_STATUS DRV_USART_Status( SYS_MODULE_OBJ object )
15988  Summary:
15989  Gets the current status of the USART driver module.
15990  <p><b>Implementation:</b> Static/Dynamic</p>
15991  Description:
15992  This routine provides the current status of the USART driver module.
15993  Precondition:
15994  Function DRV_USART_Initialize should have been called before calling this
15995  function.
15996  Parameters:
15997  object - Driver object handle, returned from the
15998  DRV_USART_Initialize routine
15999  Returns:
16000  SYS_STATUS_READY - Indicates that the driver is busy with a
16001  previous system level operation and cannot start
16002  another
16003  SYS_STATUS_DEINITIALIZED - Indicates that the driver has been
16004  deinitialized
16005  Example:
16006  <code>
16007  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
16008  SYS_STATUS usartStatus;
16009  usartStatus = DRV_USART _Status(object);
16010  if (SYS_STATUS_READY == usartStatus)
16011  {
16012  // This means the driver can be opened using the
16013  // DRV_USART_Open() function.
16014  }
16015  </code>
16016  Remarks:
16017  A driver can opened only when its status is SYS_STATUS_READY.
16018 */
16019 
16020 SYS_STATUS
16022  SYS_MODULE_OBJ object ) ;
16023 // *****************************************************************************
16024 /* Function:
16025  void DRV_USART_TasksTransmit (SYS_MODULE_OBJ object );
16026  Summary:
16027  Maintains the driver's transmit state machine and implements its ISR.
16028  <p><b>Implementation:</b> Static/Dynamic</p>
16029  Description:
16030  This routine is used to maintain the driver's internal transmit state
16031  machine and implement its transmit ISR for interrupt-driven implementations.
16032  In polling mode, this function should be called from the SYS_Tasks
16033  function. In interrupt mode, this function should be called in the transmit
16034  interrupt service routine of the USART that is associated with this USART
16035  driver hardware instance.
16036  Precondition:
16037  The DRV_USART_Initialize routine must have been called for the specified
16038  USART driver instance.
16039  Parameters:
16040  object - Object handle for the specified driver instance (returned from
16041  DRV_USART_Initialize)
16042  Returns:
16043  None.
16044  Example:
16045  <code>
16046  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
16047  while (true)
16048  {
16049  DRV_USART_TasksTransmit (object);
16050  // Do other tasks
16051  }
16052  </code>
16053  Remarks:
16054  This routine is normally not called directly by an application. It is
16055  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
16056  ISR.
16057  This routine may execute in an ISR context and will never block or access any
16058  resources that may cause it to block.
16059 */
16060 
16061 void
16063  SYS_MODULE_OBJ object ) ;
16064 // *****************************************************************************
16065 /* Function:
16066  void DRV_USART_TasksReceive (SYS_MODULE_OBJ object );
16067  Summary:
16068  Maintains the driver's receive state machine and implements its ISR.
16069  <p><b>Implementation:</b> Static/Dynamic</p>
16070  Description:
16071  This routine is used to maintain the driver's internal receive state machine
16072  and implement its receive ISR for interrupt-driven implementations. In
16073  polling mode, this function should be called from the SYS_Tasks function.
16074  In interrupt mode, this function should be called in the receive interrupt
16075  service routine of the USART that is associated with this USART driver
16076  hardware instance.
16077  Precondition:
16078  The DRV_USART_Initialize routine must have been called for the specified
16079  USART driver instance.
16080  Parameters:
16081  object - Object handle for the specified driver instance (returned from
16082  DRV_USART_Initialize)
16083  Returns:
16084  None.
16085  Example:
16086  <code>
16087  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
16088  while (true)
16089  {
16090  DRV_USART_TasksReceive (object);
16091  // Do other tasks
16092  }
16093  </code>
16094  Remarks:
16095  This routine is normally not called directly by an application. It is
16096  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
16097  ISR.
16098  This routine may execute in an ISR context and will never block or access any
16099  resources that may cause it to block.
16100 */
16101 
16102 void
16104  SYS_MODULE_OBJ object ) ;
16105 // *****************************************************************************
16106 /* Function:
16107  void DRV_USART_TasksError (SYS_MODULE_OBJ object );
16108  Summary:
16109  Maintains the driver's error state machine and implements its ISR.
16110  <p><b>Implementation:</b> Static/Dynamic</p>
16111  Description:
16112  This routine is used to maintain the driver's internal error state machine
16113  and implement its error ISR for interrupt-driven implementations. In
16114  polling mode, this function should be called from the SYS_Tasks function.
16115  In interrupt mode, this function should be called in the error interrupt
16116  service routine of the USART that is associated with this USART driver
16117  hardware instance.
16118  Precondition:
16119  The DRV_USART_Initialize routine must have been called for the specified
16120  USART driver instance.
16121  Parameters:
16122  object - Object handle for the specified driver instance (returned from
16123  DRV_USART_Initialize)
16124  Returns:
16125  None.
16126  Example:
16127  <code>
16128  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
16129  while (true)
16130  {
16131  DRV_USART_TasksError (object);
16132  // Do other tasks
16133  }
16134  </code>
16135  Remarks:
16136  This routine is normally not called directly by an application. It is
16137  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
16138  ISR.
16139  This routine may execute in an ISR context and will never block or access any
16140  resources that may cause it to block.
16141 */
16142 
16143 void
16145  SYS_MODULE_OBJ object ) ;
16146 // *****************************************************************************
16147 // *****************************************************************************
16148 // Section: USART Driver Client Routines
16149 // *****************************************************************************
16150 // *****************************************************************************
16151 // *****************************************************************************
16152 /* Function:
16153  DRV_HANDLE DRV_USART_Open
16154  (
16155  const SYS_MODULE_INDEX index,
16156  const DRV_IO_INTENT ioIntent
16157  )
16158  Summary:
16159  Opens the specified USART driver instance and returns a handle to it.
16160  <p><b>Implementation:</b> Static/Dynamic</p>
16161  Description:
16162  This routine opens the specified USART driver instance and provides a
16163  handle that must be provided to all other client-level operations to
16164  identify the caller and the instance of the driver. The ioIntent
16165  parameter defines how the client interacts with this driver instance.
16166  The DRV_IO_INTENT_BLOCKING and DRV_IO_INTENT_NONBLOCKING ioIntent options
16167  additionally affect the behavior of the DRV_USART_Read and
16168  DRV_USART_Write functions. If the ioIntent is DRV_IO_INTENT_NONBLOCKING,
16169  then these function will not block even if the required amount of data could
16170  not be processed. If the ioIntent is DRV_IO_INTENT_BLOCKING, these functions
16171  will block until the required amount of data is processed. If the driver is
16172  configured for polling and bare-metal operation, it will not support
16173  DRV_IO_INTENT_BLOCKING. The driver will operation will always be
16174  non-blocking.
16175  If ioIntent is DRV_IO_INTENT_READ, the client will only be able to read from
16176  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be able
16177  to write to the driver. If the ioIntent is DRV_IO_INTENT_READWRITE, the
16178  client will be able to do both, read and write.
16179  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
16180  exclusive access to this client. The driver cannot be opened by any
16181  other client.
16182  Precondition:
16183  Function DRV_USART_Initialize must have been called before calling this
16184  function.
16185  Parameters:
16186  index - Identifier for the object instance to be opened
16187  intent - Zero or more of the values from the enumeration
16188  DRV_IO_INTENT "ORed" together to indicate the intended use
16189  of the driver. See function description for details.
16190  Returns:
16191  If successful, the routine returns a valid open-instance handle (a number
16192  identifying both the caller and the module instance).
16193  If an error occurs, the return value is DRV_HANDLE_INVALID. Error can occur
16194  - if the number of client objects allocated via DRV_USART_CLIENTS_NUMBER is
16195  insufficient.
16196  - if the client is trying to open the driver but driver has been opened
16197  exclusively by another client.
16198  - if the driver hardware instance being opened is not initialized or is
16199  invalid.
16200  - if the client is trying to open the driver exclusively, but has already
16201  been opened in a non exclusive mode by another client.
16202  - if the driver is not ready to be opened, typically when the initialize
16203  routine has not completed execution.
16204  Example:
16205  <code>
16206  DRV_HANDLE handle;
16207  handle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
16208  if (DRV_HANDLE_INVALID == handle)
16209  {
16210  // Unable to open the driver
16211  // May be the driver is not initialized or the initialization
16212  // is not complete.
16213  }
16214  </code>
16215  Remarks:
16216  The handle returned is valid until the DRV_USART_Close routine is called.
16217  This routine will NEVER block waiting for hardware.If the requested intent
16218  flags are not supported, the routine will return DRV_HANDLE_INVALID. This
16219  function is thread safe in a RTOS application.
16220 */
16221 
16222 DRV_HANDLE
16223  DRV_USART_Open (
16224  const SYS_MODULE_INDEX index ,
16225  const DRV_IO_INTENT ioIntent ) ;
16226 // *****************************************************************************
16227 /* Function:
16228  void DRV_USART_Close( DRV_Handle handle )
16229  Summary:
16230  Closes an opened-instance of the USART driver.
16231  <p><b>Implementation:</b> Static/Dynamic</p>
16232  Description:
16233  This routine closes an opened-instance of the USART driver, invalidating the
16234  handle. Any buffers in the driver queue that were submitted by this client
16235  will be removed. After calling this routine, the handle passed in "handle"
16236  must not be used with any of the remaining driver routines (with one
16237  possible exception described in the "Remarks" section). A new handle must
16238  be obtained by calling DRV_USART_Open before the caller may use the driver
16239  again
16240  Precondition:
16241  The DRV_USART_Initialize routine must have been called for the specified
16242  USART driver instance.
16243  DRV_USART_Open must have been called to obtain a valid opened device handle.
16244  Parameters:
16245  handle - A valid open-instance handle, returned from the driver's
16246  open routine
16247  Returns:
16248  None.
16249  Example:
16250  <code>
16251  DRV_HANDLE handle; // Returned from DRV_USART_Open
16252  DRV_USART_Close(handle);
16253  // After this point, the handle cannot be used with any other function
16254  // except the DRV_USART_ClientStatus function, which can be used to query
16255  // the success status of the DRV_USART_Close function.
16256  while(DRV_USART_CLIENT_STATUS_CLOSED != DRV_USART_ClientStatus(handle));
16257  </code>
16258  Remarks:
16259  Usually there is no need for the client to verify that the Close operation
16260  has completed. The driver will abort any ongoing operations when this
16261  routine is called. However, if it requires additional time to do so in a
16262  non-blocking environment, it will still return from the Close operation but
16263  the handle is now a zombie handle. The client can only call the
16264  DRV_USART_ClientStatus on a zombie handle to track the completion of the
16265  Close operation. The DRV_USART_ClientStatus routine will return
16266  DRV_CLIENT_STATUS_CLOSED when the close operation has completed.
16267 */
16268 
16269 void
16270  DRV_USART_Close (
16271  const DRV_HANDLE handle ) ;
16272 // *****************************************************************************
16273 /*
16274  Function:
16275  DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus( DRV_HANDLE handle )
16276  Summary:
16277  Gets the current client-specific status the USART driver.
16278  <p><b>Implementation:</b> Static/Dynamic</p>
16279  Description:
16280  This function gets the client-specific status of the USART driver associated
16281  with the given handle. This function can be used to check the status of
16282  client after the DRV_USART_Close() function has been called.
16283  Preconditions:
16284  The DRV_USART_Initialize function must have been called.
16285  DRV_USART_Open must have been called to obtain a valid opened device
16286  handle.
16287  Parameters:
16288  handle - Handle returned from the driver's open function.
16289  Returns:
16290  A DRV_USART_CLIENT_STATUS value describing the current status of the
16291  driver.
16292  Example:
16293  <code>
16294  DRV_HANDLE handle; // Returned from DRV_USART_Open
16295  DRV_USART_CLIENT_STATUS status;
16296  status = DRV_USART_ClientStatus(handle);
16297  if( DRV_USART_CLIENT_STATUS_CLOSED != status )
16298  {
16299  // The client had not closed.
16300  }
16301  </code>
16302  Remarks:
16303  This function will not block for hardware access and will immediately return
16304  the current status. This function is thread safe when called in a RTOS
16305  application.
16306 */
16307 
16310  DRV_HANDLE handle ) ;
16311 // *****************************************************************************
16312 // *****************************************************************************
16313 // Section: USART Driver Buffer Queuing Model Interface Routines
16314 // *****************************************************************************
16315 // *****************************************************************************
16316 // *****************************************************************************
16317 /* Function:
16318  void DRV_USART_BufferAddWrite
16319  (
16320  const DRV_HANDLE handle,
16321  DRV_USART_BUFFER_HANDLE * bufferHandle,
16322  void * buffer,
16323  size_t size
16324  );
16325  Summary:
16326  Schedule a non-blocking driver write operation.
16327  <p><b>Implementation:</b> Static/Dynamic</p>
16328  Description:
16329  This function schedules a non-blocking write operation. The function returns
16330  with a valid buffer handle in the bufferHandle argument if the write request
16331  was scheduled successfully. The function adds the request to the hardware
16332  instance transmit queue and returns immediately. While the request is in the
16333  queue, the application buffer is owned by the driver and should not be
16334  modified. On returning, the bufferHandle parameter may be
16335  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
16336  - if a buffer could not be allocated to the request
16337  - if the input buffer pointer is NULL
16338  - if the client opened the driver for read-only
16339  - if the buffer size is 0
16340  - if the transmit queue is full or the queue depth is insufficient
16341  If the requesting client registered an event callback with the driver, the
16342  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16343  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16344  was not processed successfully.
16345  Precondition:
16346  The DRV_USART_Initialize routine must have been called for the specified
16347  USART device instance and the DRV_USART_Status must have returned
16348  SYS_STATUS_READY.
16349  DRV_USART_Open must have been called to obtain a valid opened device handle.
16350  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16351  the DRV_USART_Open call.
16352  Parameters:
16353  handle - Handle of the communication channel as return by the
16354  DRV_USART_Open function.
16355  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16356  buffer - Data to be transmitted.
16357  size - Buffer size in bytes.
16358  Returns:
16359  The bufferHandle parameter will contain the return buffer handle. This will be
16360  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16361  Example:
16362  <code>
16363  MY_APP_OBJ myAppObj;
16364  uint8_t mybuffer[MY_BUFFER_SIZE];
16365  DRV_USART_BUFFER_HANDLE bufferHandle;
16366  // myUSARTHandle is the handle returned
16367  // by the DRV_USART_Open function.
16368  // Client registers an event handler with driver
16369  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16370  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16371  DRV_USART_BufferAddWrite(myUSARThandle, &bufferHandle,
16372  myBuffer, MY_BUFFER_SIZE);
16373  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16374  {
16375  // Error handling here
16376  }
16377  // Event is received when
16378  // the buffer is processed.
16379  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16380  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16381  {
16382  // contextHandle points to myAppObj.
16383  switch(event)
16384  {
16385  case DRV_USART_BUFFER_EVENT_COMPLETE:
16386  // This means the data was transferred.
16387  break;
16388  case DRV_USART_BUFFER_EVENT_ERROR:
16389  // Error handling here.
16390  break;
16391  default:
16392  break;
16393  }
16394  }
16395  </code>
16396  Remarks:
16397  This function is thread safe in a RTOS application. It can be called from
16398  within the USART Driver Buffer Event Handler that is registered by this
16399  client. It should not be called in the event handler associated with another
16400  USART driver instance. It should not otherwise be called directly in an ISR.
16401 */
16402 
16403 void
16405  const DRV_HANDLE handle ,
16406  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16407  void * buffer ,
16408  const size_t size ) ;
16409 // *****************************************************************************
16410 /* Function:
16411  void DRV_USART_AddressedBufferAddWrite
16412  (
16413  const DRV_HANDLE hClient,
16414  DRV_USART_BUFFER_HANDLE * bufferHandle,
16415  uint8_t address,
16416  void * source,
16417  size_t nWords
16418  );
16419  Summary:
16420  Schedule a non-blocking addressed driver write operation.
16421  <p><b>Implementation:</b> Dynamic</p>
16422  Description:
16423  This function schedules a non-blocking addressed write operation. The function returns
16424  with a valid buffer handle in the bufferHandle argument if the addressed write request
16425  was scheduled successfully. The function adds the request to the hardware
16426  instance transmit queue and returns immediately. While the request is in the
16427  queue, the application buffer is owned by the driver and should not be
16428  modified. On returning, the bufferHandle parameter may be
16429  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
16430  - if a buffer could not be allocated to the request
16431  - if the input buffer pointer is NULL
16432  - if the client opened the driver for read-only
16433  - if the buffer size is 0
16434  - if the transmit queue is full or the queue depth is insufficient
16435  If the requesting client registered an event callback with the driver, the
16436  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16437  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16438  was not processed successfully.
16439  Precondition:
16440  The DRV_USART_Initialize routine must have been called for the specified
16441  USART device instance and the DRV_USART_Status must have returned
16442  SYS_STATUS_READY.
16443  DRV_USART_Open must have been called to obtain a valid opened device handle.
16444  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16445  the DRV_USART_Open call.
16446  The operation mode of the driver must be DRV_USART_OPERATION_MODE_ADDRESSED.
16447  Parameters:
16448  hClient - Handle of the communication channel as return by the
16449  DRV_USART_Open function.
16450  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16451  address - Address of the receiver client
16452  source - Data to be transmitted.
16453  size - Buffer size in 16-bit words.
16454  Returns:
16455  The bufferHandle parameter will contain the return buffer handle. This will be
16456  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16457  Example:
16458  <code>
16459  MY_APP_OBJ myAppObj;
16460  uint16_t mybuffer[MY_BUFFER_SIZE];
16461  DRV_USART_BUFFER_HANDLE bufferHandle;
16462  uint8_t clientAddress;
16463  // myUSARTHandle is the handle returned
16464  // by the DRV_USART_Open function.
16465  // Client registers an event handler with driver
16466  clientAddress = 0x60;
16467  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16468  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16469  DRV_USART_AddressedBufferAddWrite(myUSARThandle, &bufferHandle, clientAddress
16470  myBuffer, MY_BUFFER_SIZE);
16471  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16472  {
16473  // Error handling here
16474  }
16475  // Event is received when
16476  // the buffer is processed.
16477  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16478  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16479  {
16480  // contextHandle points to myAppObj.
16481  switch(event)
16482  {
16483  case DRV_USART_BUFFER_EVENT_COMPLETE:
16484  // This means the data was transferred.
16485  break;
16486  case DRV_USART_BUFFER_EVENT_ERROR:
16487  // Error handling here.
16488  break;
16489  default:
16490  break;
16491  }
16492  }
16493  </code>
16494  Remarks:
16495  This function is thread safe in a RTOS application. It can be called from
16496  within the USART Driver Buffer Event Handler that is registered by this
16497  client. It should not be called in the event handler associated with another
16498  USART driver instance. It should not otherwise be called directly in an ISR.
16499  The source buffer should be a 16-bit word aligned buffer.
16500  The 9th bit of the higher byte 16-bit buffer is used to indicate data/address.
16501 */
16502 
16503 void
16505  const DRV_HANDLE hClient ,
16506  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16507  uint8_t address ,
16508  void * source ,
16509  size_t nWords ) ;
16510 // *****************************************************************************
16511 /* Function:
16512  void DRV_USART_BufferAddRead
16513  (
16514  const DRV_HANDLE handle,
16515  DRV_USART_BUFFER_HANDLE * bufferHandle,
16516  void * buffer,
16517  const size_t size
16518  )
16519  Summary:
16520  Schedule a non-blocking driver read operation.
16521  <p><b>Implementation:</b> Static/Dynamic</p>
16522  Description:
16523  This function schedules a non-blocking read operation. The function returns
16524  with a valid buffer handle in the bufferHandle argument if the read request
16525  was scheduled successfully. The function adds the request to the hardware
16526  instance receive queue and returns immediately. While the request is in the
16527  queue, the application buffer is owned by the driver and should not be
16528  modified. The function returns DRV_USART_BUFFER_HANDLE_INVALID in the
16529  bufferHandle argument:
16530  - if a buffer could not be allocated to the request
16531  - if the input buffer pointer is NULL
16532  - if the buffer size is 0
16533  - if the read queue size is full or queue depth is insufficient.
16534  - if the driver handle is invalid
16535  If the requesting client registered an event callback with the driver, the
16536  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16537  processed successfully of DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16538  was not processed successfully.
16539  Precondition:
16540  The DRV_USART_Initialize routine must have been called for the specified
16541  USART device instance and the DRV_USART_Status must have returned
16542  SYS_STATUS_READY.
16543  DRV_USART_Open must have been called to obtain a valid opened device handle.
16544  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16545  the DRV_USART_Open call.
16546  Parameters:
16547  handle - Handle of the communication channel as returned by the
16548  DRV_USART_Open function.
16549  buffer - Buffer where the received data will be stored.
16550  size - Buffer size in bytes.
16551  Returns:
16552  The buffer handle is returned in the bufferHandle argument. This is
16553  DRV_USART_BUFFER_HANDLE_INVALID if the request was not successful.
16554  Example:
16555  <code>
16556  MY_APP_OBJ myAppObj;
16557  uint8_t mybuffer[MY_BUFFER_SIZE];
16558  DRV_USART_BUFFER_HANDLE bufferHandle;
16559  // myUSARTHandle is the handle returned
16560  // by the DRV_USART_Open function.
16561  // Client registers an event handler with driver
16562  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16563  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16564  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle,
16565  myBuffer, MY_BUFFER_SIZE);
16566  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16567  {
16568  // Error handling here
16569  }
16570  // Event is received when
16571  // the buffer is processed.
16572  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16573  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16574  {
16575  // contextHandle points to myAppObj.
16576  switch(event)
16577  {
16578  case DRV_USART_BUFFER_EVENT_COMPLETE:
16579  // This means the data was transferred.
16580  break;
16581  case DRV_USART_BUFFER_EVENT_ERROR:
16582  // Error handling here.
16583  break;
16584  default:
16585  break;
16586  }
16587  }
16588  </code>
16589  Remarks:
16590  This function is thread safe in a RTOS application. It can be called from
16591  within the USART Driver Buffer Event Handler that is registered by the
16592  client. It should not be called in the event handler associated with another
16593  USART driver instance. It should not be called directly in an ISR.
16594 */
16595 
16596 void
16598  const DRV_HANDLE handle ,
16599  DRV_USART_BUFFER_HANDLE * const bufferHandle ,
16600  void * buffer ,
16601  const size_t size ) ;
16602 // *****************************************************************************
16603 /* Function:
16604  void DRV_USART_BufferEventHandlerSet
16605  (
16606  const DRV_HANDLE handle,
16607  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler,
16608  const uintptr_t context
16609  )
16610  Summary:
16611  Allows a client to identify a buffer event handling function for the driver
16612  to call back when queued buffer transfers have finished.
16613  <p><b>Implementation:</b> Static/Dynamic</p>
16614  Description:
16615  This function allows a client to identify a buffer event handling function
16616  for the driver to call back when queued buffer transfers have finished.
16617  When a client calls either the DRV_USART_BufferAddRead or
16618  DRV_USART_BufferAddWrite function, it is provided with a handle identifying
16619  the buffer that was added to the driver's buffer queue. The driver will
16620  pass this handle back to the client by calling "eventHandler" function when
16621  the buffer transfer has completed.
16622  The event handler should be set before the client performs any "buffer add"
16623  operations that could generate events. The event handler once set, persists
16624  until the client closes the driver or sets another event handler (which
16625  could be a "NULL" pointer to indicate no callback).
16626  Precondition:
16627  The DRV_USART_Initialize routine must have been called for the specified
16628  USART driver instance.
16629  DRV_USART_Open must have been called to obtain a valid opened device handle.
16630  Parameters:
16631  handle - A valid open-instance handle, returned from the driver's
16632  open routine
16633  eventHandler - Pointer to the event handler function.
16634  context - The value of parameter will be passed back to the client
16635  unchanged, when the eventHandler function is called. It can
16636  be used to identify any client specific data object that
16637  identifies the instance of the client module (for example,
16638  it may be a pointer to the client module's state structure).
16639  Returns:
16640  None.
16641  Example:
16642  <code>
16643  // myAppObj is an application specific state data object.
16644  MY_APP_OBJ myAppObj;
16645  uint8_t mybuffer[MY_BUFFER_SIZE];
16646  DRV_USART_BUFFER_HANDLE bufferHandle;
16647  // myUSARTHandle is the handle returned
16648  // by the DRV_USART_Open function.
16649  // Client registers an event handler with driver. This is done once
16650  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16651  (uintptr_t)&myAppObj );
16652  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle
16653  myBuffer, MY_BUFFER_SIZE);
16654  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16655  {
16656  // Error handling here
16657  }
16658  // Event Processing Technique. Event is received when
16659  // the buffer is processed.
16660  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16661  DRV_USART_BUFFER_HANDLE handle, uintptr_t context)
16662  {
16663  // The context handle was set to an application specific
16664  // object. It is now retrievable easily in the event handler.
16665  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) context;
16666  switch(event)
16667  {
16668  case DRV_USART_BUFFER_EVENT_COMPLETE:
16669  // This means the data was transferred.
16670  break;
16671  case DRV_USART_BUFFER_EVENT_ERROR:
16672  // Error handling here.
16673  break;
16674  default:
16675  break;
16676  }
16677  }
16678  </code>
16679  Remarks:
16680  If the client does not want to be notified when the queued buffer transfer
16681  has completed, it does not need to register a callback. This function is
16682  thread safe when called in a RTOS application.
16683 */
16684 
16685 void
16687  const DRV_HANDLE handle ,
16688  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler ,
16689  const uintptr_t context ) ;
16690 // *****************************************************************************
16691 /* Function:
16692  DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove( DRV_USART_BUFFER_HANDLE bufferHandle )
16693  Summary:
16694  Removes a requested buffer from the queue.
16695  <p><b>Implementation:</b> Static/Dynamic</p>
16696  Description:
16697  This function removes a specified buffer from the queue.
16698  The client can use this function to delete
16699  1. An unwated stalled buffer.
16700  2. Queued buffers on timeout.
16701  or in any other use case.
16702  Precondition:
16703  The DRV_USART_Initialize routine must have been called for the specified
16704  USART driver instance.
16705  DRV_USART_Open must have been called to obtain a valid opened device handle.
16706  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16707  must have been called and a valid buffer handle returned.
16708  Parameters:
16709  bufferhandle - Handle of the buffer to delete.
16710  Returns:
16711  DRV_USART_BUFFER_RESULT_HANDLE_INVALID - Buffer handle is invalid.
16712  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED - Buffer handle is expired.
16713  DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY - Buffer is removed from the
16714  queue successfully.
16715  DRV_USART_BUFFER_RESULT_REMOVAL_FAILED - Failed to remove buffer from
16716  the queue because of mutex timeout in RTOS environment.
16717  Example:
16718  <code>
16719  // myAppObj is an application specific object.
16720  MY_APP_OBJ myAppObj;
16721  uint8_t mybuffer[MY_BUFFER_SIZE];
16722  DRV_USART_BUFFER_HANDLE bufferHandle;
16723  // myUSARTHandle is the handle returned
16724  // by the DRV_USART_Open function.
16725  // Client registers an event handler with driver. This is done once
16726  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16727  (uintptr_t)&myAppObj );
16728  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16729  myBuffer, MY_BUFFER_SIZE );
16730  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16731  {
16732  // Error handling here
16733  }
16734  // Event Processing Technique. Event is received when
16735  // the buffer is processed.
16736  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16737  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16738  {
16739  switch(event)
16740  {
16741  case DRV_USART_BUFFER_EVENT_COMPLETE:
16742  // This means the data was transferred.
16743  break;
16744  case DRV_USART_BUFFER_EVENT_ERROR:
16745  // Error handling here.
16746  break;
16747  default:
16748  break;
16749  }
16750  }
16751  // Timeout function, where remove queued buffer if it still exists.
16752  void APP_TimeOut(void)
16753  {
16754  DRV_USART_BUFFER_RESULT bufferResult;
16755  bufferResult = DRV_USART_BufferRemove(bufferHandle);
16756  if(DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY == bufferResult)
16757  {
16758  //Buffer removed succesfully from the queue
16759  }
16760  else
16761  {
16762  //Either buffer is invalid or expired.
16763  //Or not able to acquire mutex in RTOS mode.
16764  }
16765  }
16766  </code>
16767  Remarks:
16768  This function is thread safe when used in a RTOS application.
16769 */
16770 
16773  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16774 // *****************************************************************************
16775 /* Function:
16776  size_t DRV_USART_BufferCompletedBytesGet
16777  (
16778  DRV_USART_BUFFER_HANDLE bufferHandle
16779  );
16780  Summary:
16781  Returns the number of bytes that have been processed for the
16782  specified buffer.
16783  <p><b>Implementation:</b> Static/Dynamic</p>
16784  Description:
16785  This function returns number of bytes that have been processed for the
16786  specified buffer. The client can use this function, in a case where the
16787  buffer has terminated due to an error, to obtain the number of bytes that
16788  have been processed. Or in any other use case.
16789  This function can be used for non-DMA buffer transfers only. It cannot be
16790  used when the USART driver is configured to use DMA.
16791  Precondition:
16792  The DRV_USART_Initialize routine must have been called for the specified
16793  USART driver instance.
16794  DRV_USART_Open must have been called to obtain a valid opened device handle.
16795  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16796  must have been called and a valid buffer handle returned.
16797  Parameters:
16798  bufferhandle - Handle for the buffer of which the processed number of bytes
16799  to be obtained.
16800  Returns:
16801  Returns the number of bytes that have been processed for this buffer.
16802  Returns DRV_USART_BUFFER_HANDLE_INVALID for an invalid or an expired
16803  buffer handle.
16804  Example:
16805  <code>
16806  // myAppObj is an application specific object.
16807  MY_APP_OBJ myAppObj;
16808  uint8_t mybuffer[MY_BUFFER_SIZE];
16809  DRV_USART_BUFFER_HANDLE bufferHandle;
16810  // myUSARTHandle is the handle returned
16811  // by the DRV_USART_Open function.
16812  // Client registers an event handler with driver. This is done once
16813  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16814  (uintptr_t)&myAppObj );
16815  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16816  myBuffer, MY_BUFFER_SIZE );
16817  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16818  {
16819  // Error handling here
16820  }
16821  // Event Processing Technique. Event is received when
16822  // the buffer is processed.
16823  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16824  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16825  {
16826  // The context handle was set to an application specific
16827  // object. It is now retrievable easily in the event handler.
16828  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
16829  size_t processedBytes;
16830  switch(event)
16831  {
16832  case DRV_USART_BUFFER_EVENT_COMPLETE:
16833  // This means the data was transferred.
16834  break;
16835  case DRV_USART_BUFFER_EVENT_ERROR:
16836  // Error handling here.
16837  // We can find out how many bytes were processed in this
16838  // buffer before the error occurred.
16839  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
16840  break;
16841  default:
16842  break;
16843  }
16844  }
16845  </code>
16846  Remarks:
16847  This function is thread safe when used in a RTOS application.
16848 */
16849 
16850 size_t
16852  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16853 // *****************************************************************************
16854 /* Function:
16855  size_t DRV_USART_BufferProcessedSizeGet
16856  (
16857  DRV_USART_BUFFER_HANDLE bufferHandle
16858  );
16859  Summary:
16860  This API will be deprecated and not recommended to use.
16861  Use DRV_USART_BufferCompletedBytesGet to get the number of bytes
16862  processed for the specified buffer.
16863  Description:
16864  None.
16865  Precondition:
16866  None.
16867  Parameters:
16868  None.
16869  Returns:
16870  None.
16871  Example:
16872  None.
16873  Remarks:
16874  None.
16875 */
16876 
16877 size_t
16879  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16880 // *****************************************************************************
16881 // *****************************************************************************
16882 // Section: USART Driver File System Model Routines
16883 // *****************************************************************************
16884 // *****************************************************************************
16885 // *****************************************************************************
16886 /* Function:
16887  size_t DRV_USART_Read
16888  (
16889  const DRV_HANDLE handle,
16890  void * buffer,
16891  const size_t numbytes
16892  )
16893  Summary:
16894  Reads data from the USART.
16895  <p><b>Implementation:</b> Static/Dynamic</p>
16896  Description:
16897  This routine reads data from the USART. This function is blocking if the
16898  driver was opened by the client for blocking operation. This function will
16899  not block if the driver was opened by the client for non blocking operation.
16900  If the ioIntent parameter at the time of opening the driver was
16901  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16902  until) numbytes of bytes have been received or if an error occurred. If there
16903  are buffers queued for receiving data, these buffers will be serviced first. The
16904  function will not return until the requested number of bytes have been read.
16905  If the ioIntent parameter at the time of opening the driver was
16906  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16907  bytes that were actually read. The function will not wait until numBytes of
16908  bytes have been read. If there are buffer queued for reading data, then the
16909  function will not block and will return immediately with 0 bytes read.
16910  Precondition:
16911  The DRV_USART_Initialize routine must have been called for the specified
16912  USART driver instance.
16913  DRV_USART_Open must have been called to obtain a valid opened device handle.
16914  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16915  the DRV_USART_Open call.
16916  Parameters:
16917  handle - A valid open-instance handle, returned from the driver's
16918  open routine
16919  buffer - Buffer into which the data read from the USART instance
16920  will be placed.
16921  numbytes - Total number of bytes that need to be read from the module
16922  instance (must be equal to or less than the size of the
16923  buffer)
16924  Returns:
16925  Number of bytes actually copied into the caller's buffer. Returns
16926  DRV_USART_READ_ERROR in case of an error.
16927  Example:
16928  <code>
16929  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16930  char myBuffer[MY_BUFFER_SIZE];
16931  unsigned int count;
16932  unsigned int total;
16933  total = 0;
16934  do
16935  {
16936  count = DRV_USART_Read(myUSARTHandle, &myBuffer[total], MY_BUFFER_SIZE - total);
16937  if(count == DRV_USART_READ_ERROR)
16938  {
16939  // There was an error. The DRV_USART_ErrorGet() function
16940  // can be called to find the exact error.
16941  }
16942  total += count;
16943  // Do something else...
16944  } while( total < MY_BUFFER_SIZE );
16945  </code>
16946  Remarks:
16947  This function is thread safe in a RTOS application. If the driver is
16948  configured for polled operation, this it will not support blocking operation
16949  in a bare metal (non-RTOS) application.
16950 */
16951 
16952 size_t
16953  DRV_USART_Read (
16954  const DRV_HANDLE handle ,
16955  void * buffer ,
16956  const size_t numbytes ) ;
16957 // *****************************************************************************
16958 /* Function:
16959  size_t DRV_USART_Write
16960  (
16961  const DRV_HANDLE handle,
16962  void * buffer,
16963  const size_t numbytes
16964  )
16965  Summary:
16966  Writes data to the USART.
16967  <p><b>Implementation:</b> Static/Dynamic</p>
16968  Description:
16969  This routine writes data to the USART. This function is blocking if the
16970  driver was opened by the client for blocking operation. This function will
16971  not block if the driver was opened by the client for non blocking operation.
16972  If the ioIntent parameter at the time of opening the driver was
16973  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16974  until) numbytes of bytes have been transmitted or if an error occurred. If
16975  there are buffers queued for writing, the function will wait until all the
16976  preceding buffers are completed. Ongoing buffer transmit operations will not
16977  be affected.
16978  If the ioIntent parameter at the time of opening the driver was
16979  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16980  bytes that were actually accepted for transmission. The function will not
16981  wait until numBytes of bytes have been transmitted. If there a buffers queued
16982  for transmit, the function will not wait and will return immediately with 0
16983  bytes.
16984  Precondition:
16985  The DRV_USART_Initialize routine must have been called for the specified
16986  USART driver instance.
16987  DRV_USART_Open must have been called to obtain a valid opened device handle.
16988  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16989  the DRV_USART_Open call.
16990  Parameters:
16991  handle - A valid open-instance handle, returned from the driver's
16992  open routine
16993  buffer - Buffer containing the data to written.
16994  numbytes - size of the buffer
16995  Returns:
16996  Number of bytes actually written to the driver. Return DRV_USART_WRITE_ERROR
16997  in case of an error.
16998  Example:
16999  <code>
17000  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17001  char myBuffer[MY_BUFFER_SIZE];
17002  int count;
17003  unsigned int total;
17004  total = 0;
17005  do
17006  {
17007  count = DRV_USART_Write(myUSARTHandle, &myBuffer[total],
17008  MY_BUFFER_SIZE - total);
17009  total += count;
17010  // Do something else...
17011  } while( total < MY_BUFFER_SIZE );
17012  </code>
17013  Remarks:
17014  This function is thread safe in a RTOS application. This function is thread
17015  safe in a RTOS application. If the driver is configured for polled
17016  operation, this it will not support blocking operation in a bare metal (non-RTOS)
17017  application.
17018 */
17019 
17020 size_t
17021  DRV_USART_Write (
17022  const DRV_HANDLE handle ,
17023  void * buffer ,
17024  const size_t numbytes ) ;
17025 // *****************************************************************************
17026 /* Function:
17027  DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus( const DRV_HANDLE handle )
17028  Summary:
17029  Returns the transmitter and receiver transfer status.
17030  <p><b>Implementation:</b> Static/Dynamic</p>
17031  Description:
17032  This returns the transmitter and receiver transfer status.
17033  Precondition:
17034  The DRV_USART_Initialize routine must have been called for the specified
17035  USART driver instance.
17036  DRV_USART_Open must have been called to obtain a valid opened device handle.
17037  Parameters:
17038  handle - A valid open-instance handle, returned from the driver's
17039  open routine
17040  Returns:
17041  A DRV_USART_TRANSFER_STATUS value describing the current status
17042  of the transfer.
17043  Example:
17044  <code>
17045  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17046  if (DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle))
17047  {
17048  // Data has been received that can be read
17049  }
17050  </code>
17051  Remarks:
17052  The returned status may contain a value with more than one of the bits
17053  specified in the DRV_USART_TRANSFER_STATUS enumeration set. The caller
17054  should perform an "AND" with the bit of interest and verify if the result is
17055  non-zero (as shown in the example) to verify the desired status bit. This
17056  function is thread safe when called in a RTOS application.
17057 */
17058 
17061  const DRV_HANDLE handle ) ;
17062 // *****************************************************************************
17063 // *****************************************************************************
17064 // Section: USART Driver Byte Model Routines
17065 // *****************************************************************************
17066 // *****************************************************************************
17067 // *****************************************************************************
17068 /* Function:
17069  uint8_t DRV_USART_ReadByte( const DRV_HANDLE handle )
17070  Summary:
17071  Reads a byte of data from the USART.
17072  <p><b>Implementation:</b> Static/Dynamic</p>
17073  Description:
17074  This routine reads a byte of data from the USART.
17075  Precondition:
17076  The DRV_USART_Initialize routine must have been called for the specified
17077  USART driver instance.
17078  DRV_USART_Open must have been called to obtain a valid opened device handle.
17079  The transfer status should be checked to see if the receiver is not empty
17080  before calling this function.
17081  Parameters:
17082  handle - A valid open-instance handle, returned from the driver's
17083  open routine
17084  Returns:
17085  A data byte received by the driver.
17086  Example:
17087  <code>
17088  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17089  char myBuffer[MY_BUFFER_SIZE];
17090  unsigned int numBytes;
17091  numBytes = 0;
17092  do
17093  {
17094  if( DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle) )
17095  {
17096  myBuffer[numBytes++] = DRV_USART_ReadByte(myUSARTHandle);
17097  }
17098  // Do something else...
17099  } while( numBytes < MY_BUFFER_SIZE);
17100  </code>
17101  Remarks:
17102  This function is thread safe when called in a RTOS application. Note that
17103  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
17104  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
17105  DRV_USART_Write functions in a application. Calling the
17106  DRV_USART_ReadByte and DRV_USART_WriteByte functions will disrupt the
17107  processing of any queued buffers.
17108 */
17109 
17110 uint8_t
17112  const DRV_HANDLE handle ) ;
17113 // *****************************************************************************
17114 /* Function:
17115  void DRV_USART_WriteByte( const DRV_HANDLE handle, const uint8_t byte)
17116  Summary:
17117  Writes a byte of data to the USART.
17118  <p><b>Implementation:</b> Static/Dynamic</p>
17119  Description:
17120  This routine writes a byte of data to the USART.
17121  Precondition:
17122  The DRV_USART_Initialize routine must have been called for the specified
17123  USART driver instance.
17124  DRV_USART_Open must have been called to obtain a valid opened device handle.
17125  The transfer status should be checked to see if transmitter is not full
17126  before calling this function.
17127  Parameters:
17128  handle - A valid open-instance handle, returned from the driver's
17129  open routine
17130  byte - Data byte to write to the USART
17131  Returns:
17132  None.
17133  Example:
17134  <code>
17135  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17136  char myBuffer[MY_BUFFER_SIZE];
17137  unsigned int numBytes;
17138  // Preinitialize myBuffer with MY_BUFFER_SIZE bytes of valid data.
17139  numBytes = 0;
17140  while( numBytes < MY_BUFFER_SIZE );
17141  {
17142  if( !(DRV_USART_TRANSFER_STATUS_TRANSMIT_FULL & DRV_USART_TransferStatus(myUSARTHandle)) )
17143  {
17144  DRV_USART_WriteByte(myUSARTHandle, myBuffer[numBytes++]);
17145  }
17146  // Do something else...
17147  }
17148  </code>
17149  Remarks:
17150  This function is thread safe when called in a RTOS application. Note that
17151  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
17152  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
17153  DRV_USART_Write functions in a application. Calling the
17154  DRV_USART_ReadByte and DRV_USART_WriteByte function will disrupt the
17155  processing of any queued buffers.
17156 */
17157 
17158 void
17160  const DRV_HANDLE handle ,
17161  const uint8_t byte ) ;
17162 // *****************************************************************************
17163 /* Function:
17164  unsigned int DRV_USART_ReceiverBufferSizeGet( const DRV_HANDLE handle )
17165  Summary:
17166  Returns the size of the receive buffer.
17167  <p><b>Implementation:</b> Static/Dynamic</p>
17168  Description:
17169  This routine returns the size of the receive buffer.
17170  Precondition:
17171  The DRV_USART_Initialize routine must have been called for the specified
17172  USART driver instance.
17173  DRV_USART_Open must have been called to obtain a valid opened device handle.
17174  Parameters:
17175  handle - A valid open-instance handle, returned from the driver's
17176  open routine
17177  Returns:
17178  Size of the driver's receive buffer, in bytes.
17179  Example:
17180  <code>
17181  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17182  const uint8_t readBuffer[5];
17183  unsigned int size, numBytes = 0;
17184  unsigned int readbufferLen = sizeof(readBuffer);
17185  size = DRV_USART_ReceiverBufferSizeGet(myUSARTHandle);
17186  // Do something based on the receiver buffer size
17187  </code>
17188  Remarks:
17189  Does not account for client queued buffers. This function is thread safe
17190  when called in a RTOS application.
17191 */
17192 
17193 unsigned int
17195  const DRV_HANDLE handle ) ;
17196 // *****************************************************************************
17197 /* Function:
17198  unsigned int DRV_USART_TransmitBufferSizeGet ( const DRV_HANDLE handle )
17199  Summary:
17200  Returns the size of the transmit buffer.
17201  <p><b>Implementation:</b> Static/Dynamic</p>
17202  Description:
17203  This routine returns the size of the transmit buffer and can be used by the
17204  application to determine the number of bytes to write with the
17205  DRV_USART_WriteByte function.
17206  Precondition:
17207  The DRV_USART_Initialize routine must have been called for the specified
17208  USART driver instance.
17209  DRV_USART_Open must have been called to obtain a valid opened device handle.
17210  Parameters:
17211  handle - A valid open-instance handle, returned from the driver's
17212  open routine
17213  Returns:
17214  Size of the driver's transmit buffer, in bytes.
17215  Examples:
17216  <code>
17217  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17218  const uint8_t writeBuffer[5];
17219  unsigned int size, numBytes = 0;
17220  unsigned int writeBufferLen = sizeof(writeBuffer);
17221  size = DRV_USART_TransmitBufferSizeGet (myUSARTHandle);
17222  // Do something based on the transmitter buffer size
17223  </code>
17224  Remarks:
17225  Does not account for client queued buffers. This function is thread safe
17226  when used in a RTOS application.
17227 */
17228 
17229 unsigned int
17231  const DRV_HANDLE handle ) ;
17232 // *****************************************************************************
17233 /* Function:
17234  bool DRV_USART_ReceiverBufferIsEmpty( const DRV_HANDLE handle )
17235  Summary:
17236  Provides the status of the driver's receive buffer.
17237  <p><b>Implementation:</b> Static/Dynamic</p>
17238  Description:
17239  This routine indicates if the driver's receiver buffer is empty. This
17240  function can be used in conjunction with the DRV_USART_Read and
17241  DRV_USART_ReadByte functions.
17242  Precondition:
17243  The DRV_USART_Initialize routine must have been called for the specified
17244  USART driver instance.
17245  DRV_USART_Open must have been called to obtain a valid opened device handle.
17246  Parameters:
17247  handle - A valid open-instance handle, returned from the driver's
17248  open routine
17249  Returns:
17250  true - if the driver's receive buffer is empty
17251  false - if the driver's receive buffer is not empty
17252  Example:
17253  <code>
17254  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17255  char myBuffer[MY_BUFFER_SIZE];
17256  unsigned int numBytes;
17257  numBytes = 0;
17258  while( numBytes < MY_BUFFER_SIZE );
17259  {
17260  if ( !DRV_USART_ReceiverBufferIsEmpty(myUSARTHandle) )
17261  {
17262  if( numBytes < MY_BUFFER_SIZE )
17263  {
17264  myBuffer[numBytes++] = DRV_USART_ReadByte (myUSARTHandle);
17265  }
17266  else
17267  {
17268  break;
17269  }
17270  }
17271  // Do something else while more data is received.
17272  }
17273  </code>
17274  Remarks:
17275  Does not account for client queued buffers. This function is safe thread
17276  safe when used in a RTOS application.
17277 */
17278 
17279 bool
17281  const DRV_HANDLE handle ) ;
17282 // *****************************************************************************
17283 /* Function:
17284  bool DRV_USART_TransmitBufferIsFull( const DRV_HANDLE handle )
17285  Summary:
17286  Provides the status of the driver's transmit buffer.
17287  <p><b>Implementation:</b> Static/Dynamic</p>
17288  Description:
17289  This routine identifies if the driver's transmit buffer is full or not. This
17290  function can be used in conjunction with the DRV_USART_Write and
17291  DRV_USART_WriteByte functions.
17292  Precondition:
17293  The DRV_USART_Initialize routine must have been called for the specified
17294  USART driver instance.
17295  DRV_USART_Open must have been called to obtain a valid opened device handle.
17296  Parameters:
17297  handle - A valid open-instance handle, returned from the driver's
17298  open routine
17299  Returns:
17300  true - if the transmit buffer is full
17301  false - if the transmit buffer is not full
17302  Example:
17303  <code>
17304  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
17305  unsigned int numBytes;
17306  int bytesToWrite;
17307  const uint8_t writeBuffer[35] = "1234567890ABCDEFGHIJKLMNOP\n" ;
17308  int writebufferLen = strlen((char *)writeBuffer);
17309  numBytes = 0;
17310  while( numBytes < writebufferLen )
17311  {
17312  if (DRV_USART_TransmitBufferisFull())
17313  {
17314  // Do something else until there is some room in the driver's Transmit buffer.
17315  }
17316  else
17317  {
17318  DRV_USART_WriteByte(myUSARTHandle, writeBuffer[numBytes++]);
17319  }
17320  }
17321  </code>
17322  Remarks:
17323  Does not account for client queued buffers. This function is thread safe
17324  when called in a RTOS application.
17325 */
17326 
17327 bool
17329  const DRV_HANDLE handle ) ;
17330 // *****************************************************************************
17331 /* Function:
17332  void DRV_USART_ByteTransmitCallbackSet
17333  (
17334  const SYS_MODULE_INDEX index,
17335  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17336  )
17337  Summary:
17338  Registers a callback function for byte transmit event.
17339  Description:
17340  This function allows a transmit callback function to be registered with the
17341  driver. The callback function is invoked when a byte has been transmitted
17342  using DRV_USART_WriteByte () function.
17343  The callback function should be registered with the driver prior to any
17344  writes to the driver. The callback functionality is available only in the
17345  interrupt mode of operation. The driver clears the interrupt after invoking
17346  the callback function.
17347  Precondition:
17348  The DRV_USART_Initialize routine must have been called for the specified
17349  USART driver instance.
17350  Parameters:
17351  index - Identifier for the object instance to be opened
17352  eventHandler - Pointer to the event handler function.
17353  Returns:
17354  None.
17355  Example:
17356  <code>
17357  // myAppObj is an application specific state data object.
17358  MY_APP_OBJ myAppObj;
17359  uint8_t mybuffer[MY_BUFFER_SIZE];
17360  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17361  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17362  (uintptr_t)&myAppObj );
17363  // Register an event handler with driver. This is done once
17364  DRV_USART_ByteTransmitCallbackSet (DRV_USART_INDEX_0, APP_USARTTransmitEventHandler);
17365  DRV_USART_WriteByte (myUSARThandle, myBuffer[0]);
17366  // Event Processing Technique. Event is received when
17367  // the byte is transmitted.
17368  void APP_USARTTransmitEventHandler (const SYS_MODULE_INDEX index)
17369  {
17370  // Byte has been transmitted. Handle the event.
17371  }
17372  </code>
17373  Remarks:
17374  None
17375 */
17376 
17377 void
17379  const SYS_MODULE_INDEX index ,
17380  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17381 // *****************************************************************************
17382 /* Function:
17383  void DRV_USART_ByteReceiveCallbackSet
17384  (
17385  const SYS_MODULE_INDEX index,
17386  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17387  )
17388  Summary:
17389  Registers receive callback function for byte receive event.
17390  Description:
17391  This function allows a receive callback function to be registered with the
17392  driver. The callback function is invoked when a byte has been received. The
17393  received byte can then be read using DRV_USART_ReadByte() function.
17394  The callback function should be registered with the driver as part of the
17395  initialization. The callback functionality is available only in the
17396  interrupt mode of operation. The driver clears the interrupt after invoking
17397  the callback function.
17398  Precondition:
17399  The DRV_USART_Initialize routine must have been called for the specified
17400  USART driver instance.
17401  Parameters:
17402  index - Identifier for the object instance to be opened
17403  eventHandler - Pointer to the event handler function.
17404  Returns:
17405  None.
17406  Example:
17407  <code>
17408  // myAppObj is an application specific state data object.
17409  MY_APP_OBJ myAppObj;
17410  uint8_t mybuffer[MY_BUFFER_SIZE];
17411  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17412  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17413  (uintptr_t)&myAppObj );
17414  // Register an event handler with driver. This is done once
17415  DRV_USART_ByteReceiveCallbackSet(DRV_USART_INDEX_0, APP_USARTReceiveEventHandler);
17416  // Event Processing Technique. Event is received when
17417  // a byte is received.
17418  void APP_USARTReceiveEventHandler(const SYS_MODULE_INDEX index)
17419  {
17420  // Byte has been Received. Handle the event.
17421  // Read byte using DRV_USART_ReadByte ()
17422  // DRV_USART_ReceiverBufferIsEmpty() function can be used to
17423  // check if the receiver buffer is empty.
17424  }
17425  </code>
17426  Remarks:
17427  None
17428 */
17429 
17430 void
17432  const SYS_MODULE_INDEX index ,
17433  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17434 // *****************************************************************************
17435 /* Function:
17436  void DRV_USART_ByteErrorCallbackSet
17437  (
17438  const SYS_MODULE_INDEX index,
17439  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17440  )
17441  Summary:
17442  Registers callback to handle for byte error events.
17443  Description:
17444  This function allows a callback function to be registered with the driver
17445  to handle the error events occurring in the transmit/receive path during
17446  byte transfers.
17447  The callback function should be registered as part of the initialization.
17448  The callback functionality is available only in the interrupt mode of
17449  operation. The driver clears the interrupt after invoking the callback
17450  function.
17451  Precondition:
17452  The DRV_USART_Initialize routine must have been called for the specified
17453  USART driver instance.
17454  Parameters:
17455  index - Identifier for the object instance to be opened
17456  eventHandler - Pointer to the event handler function.
17457  Returns:
17458  None.
17459  Example:
17460  <code>
17461  // myAppObj is an application specific state data object.
17462  MY_APP_OBJ myAppObj;
17463  uint8_t mybuffer[MY_BUFFER_SIZE];
17464  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17465  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17466  (uintptr_t)&myAppObj );
17467  // Register an event handler with driver. This is done once
17468  DRV_USART_ByteErrorCallbackSet (DRV_USART_INDEX_0, APP_USARTErrorEventHandler);
17469  // Event Processing Technique.
17470  void APP_USARTErrorEventHandler(const SYS_MODULE_INDEX index)
17471  {
17472  // Error has occurred. Handle the event.
17473  }
17474  </code>
17475  Remarks:
17476  None
17477 */
17478 
17479 void
17481  const SYS_MODULE_INDEX index ,
17482  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17483 // *****************************************************************************
17484 // *****************************************************************************
17485 // Section: USART Driver Setup and Status Routines
17486 // *****************************************************************************
17487 // *****************************************************************************
17488 // *****************************************************************************
17489 /* Function:
17490  DRV_USART_ERROR DRV_USART_ErrorGet(DRV_HANDLE client);
17491  Summary:
17492  This function returns the error(if any) associated with the last client
17493  request.
17494  <p><b>Implementation:</b> Static/Dynamic</p>
17495  Description:
17496  This function returns the error(if any) associated with the last client
17497  request. DRV_USART_Read and DRV_USART_Write will update the client
17498  error status when these functions return DRV_USART_TRANSFER_ERROR. If the
17499  driver send a DRV_USART_BUFFER_EVENT_ERROR to the client, the client can
17500  call this function to know the error cause. The error status will be updated
17501  on every operation and should be read frequently (ideally immediately after
17502  the driver operation has completed) to know the relevant error status.
17503  Precondition:
17504  The DRV_USART_Initialize routine must have been called for the specified
17505  USART driver instance.
17506  DRV_USART_Open must have been called to obtain a valid opened device handle.
17507  Parameters:
17508  bufferhandle - Handle of the buffer of which the processed number of bytes
17509  to be obtained.
17510  Returns:
17511  A DRV_USART_ERROR type indicating last known error status.
17512  Example:
17513  <code>
17514  // myAppObj is an application specific object.
17515  MY_APP_OBJ myAppObj;
17516  uint8_t mybuffer[MY_BUFFER_SIZE];
17517  DRV_USART_BUFFER_HANDLE bufferHandle;
17518  // myUSARTHandle is the handle returned
17519  // by the DRV_USART_Open function.
17520  // Client registers an event handler with driver. This is done once.
17521  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
17522  (uintptr_t)&myAppObj );
17523  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
17524  myBuffer, MY_BUFFER_SIZE );
17525  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
17526  {
17527  // Error handling here
17528  }
17529  // Event Processing Technique. Event is received when
17530  // the buffer is processed.
17531  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
17532  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
17533  {
17534  // The context handle was set to an application specific
17535  // object. It is now retrievable easily in the event handler.
17536  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
17537  size_t processedBytes;
17538  switch(event)
17539  {
17540  case DRV_USART_BUFFER_EVENT_COMPLETE:
17541  // This means the data was transferred.
17542  break;
17543  case DRV_USART_BUFFER_EVENT_ERROR:
17544  // Error handling here.
17545  // We can find out how many bytes were processed in this
17546  // buffer before the error occurred. We can also find
17547  // the error cause.
17548  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
17549  if(DRV_USART_ERROR_RECEIVE_OVERRUN == DRV_USART_ErrorGet(myUSARTHandle))
17550  {
17551  // There was an receive over flow error.
17552  // Do error handling here.
17553  }
17554  break;
17555  default:
17556  break;
17557  }
17558  }
17559  </code>
17560  Remarks:
17561  It is the client's responsibility to make sure that the error status is
17562  obtained frequently. The driver will update the client error status
17563  regardless of whether this has been examined by the client. This function
17564  is thread safe when used in a RTOS application.
17565 */
17566 
17569  const DRV_HANDLE client ) ;
17570 // *****************************************************************************
17571 /* Function:
17572  void DRV_USART_BaudSet(DRV_HANDLE client, uint32_t baud);
17573  Summary:
17574  This function changes the USART module baud to the specified value.
17575  <p><b>Implementation:</b> Static/Dynamic</p>
17576  Description:
17577  This function changes the USART module baud to the specified value. Any
17578  queued buffer requests will be processed at the updated baud. The USART
17579  driver operates at the baud specified in DRV_USART_Initialize function
17580  unless the DRV_USART_BaudSet function is called to change the baud.
17581  Precondition:
17582  The DRV_USART_Initialize routine must have been called for the specified
17583  USART driver instance.
17584  DRV_USART_Open must have been called to obtain a valid opened device handle.
17585  Parameters:
17586  handle - client handle returned by DRV_USART_Open function.
17587  baud - desired baud.
17588  Returns:
17589  None.
17590  Example:
17591  <code>
17592  // myUSARTHandle is the handle returned
17593  // by the DRV_USART_Open function.
17594  DRV_USART_BaudSet(myUSARTHandle, 9600);
17595  </code>
17596  Remarks:
17597  The implementation of this function, in this release of the driver, changes
17598  the baud immediately. This may interrupt on-going data transfer. It is
17599  recommended that the driver be opened exclusively if this function is to be
17600  called. This function is thread safe when used in a RTOS application.
17601 */
17602 
17605  const DRV_HANDLE client ,
17606  uint32_t baud ) ;
17607 // *****************************************************************************
17608 /* Function:
17609  void DRV_USART_LineControlSet
17610  (
17611  DRV_HANDLE client,
17612  DRV_USART_LINE_CONTROL lineControl
17613  );
17614  Summary:
17615  This function changes the USART module line control to the specified value.
17616  <p><b>Implementation:</b> Static/Dynamic</p>
17617  Description:
17618  This function changes the USART module line control parameters to the
17619  specified value. Any queued buffer requests will be processed at the
17620  updated line control parameters. The USART driver operates at the line
17621  control parameters specified in DRV_USART_Initialize function unless the
17622  DRV_USART_LineControlSet function is called to change the line control
17623  parameters.
17624  Precondition:
17625  The DRV_USART_Initialize routine must have been called for the specified
17626  USART driver instance.
17627  DRV_USART_Open must have been called to obtain a valid opened device handle.
17628  Parameters:
17629  handle - client handle returned by DRV_USART_Open function.
17630  lineControl - line control parameters.
17631  Returns:
17632  DRV_USART_LINE_CONTROL_SET_SUCCESS if the function was successful. Returns
17633  DRV_HANDLE_INVALID if the client handle is not valid.
17634  Example:
17635  <code>
17636  // myUSARTHandle is the handle returned
17637  // by the DRV_USART_Open function.
17638  DRV_USART_LineControlSet(myUSARTHandle, DRV_USART_LINE_CONTROL_8NONE1);
17639  </code>
17640  Remarks:
17641  The implementation of this function, in this release of the driver, changes
17642  the line control immediately. This may interrupt on-going data transfer. It
17643  is recommended that the driver be opened exclusively if this function is to
17644  be called. This function is thread safe when called in a RTOS application.
17645 */
17646 
17649  const DRV_HANDLE client ,
17650  const DRV_USART_LINE_CONTROL lineControl ) ;
17651 //DOM-IGNORE-BEGIN
17652 //DOM-IGNORE-END
17653  // #ifndef _DRV_USART_H
17654 /*******************************************************************************
17655  End of File
17656 */
17657 
17658 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h*/
17659 /* CLOSE_FILE Include File */
17660 
17661 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h */
17662 /*******************************************************************************
17663  USART Driver Variant Mapping
17664  Company:
17665  Microchip Technology Inc.
17666  File Name:
17667  drv_usart_variant_mapping.h
17668  Summary:
17669  USART Driver Variant Mapping
17670  Description:
17671  This file provides feature and build variant mapping macros allowing the
17672  driver to easily be built with different implementation variations based
17673  on static build-time configuration selections.
17674 *******************************************************************************/
17675 //DOM-IGNORE-BEGIN
17676 /*******************************************************************************
17677 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
17678 Microchip licenses to you the right to use, modify, copy and distribute
17679 Software only when embedded on a Microchip microcontroller or digital signal
17680 controller that is integrated into your product or third party product
17681 (pursuant to the sublicense terms in the accompanying license agreement).
17682 You should refer to the license agreement accompanying this Software for
17683 additional information regarding your rights and obligations.
17684 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17685 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17686 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17687 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17688 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17689 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17690 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17691 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17692 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17693 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17694 *******************************************************************************/
17695 //DOM-IGNORE-END
17696 #ifndef _DRV_USART_FEATURE_MAPPING_H
17697 #define _DRV_USART_FEATURE_MAPPING_H
17698 // *****************************************************************************
17699 // *****************************************************************************
17700 // Section: Interrrupt Variations
17701 // *****************************************************************************
17702 // *****************************************************************************
17703 /* Mapping of the interrupt mode variations
17704 */
17705  /* Driver is configured for polled mode */
17706 #define _DRV_USART_InterruptSourceIsEnabled( source ) false
17707 #define _DRV_USART_InterruptSourceEnable( source )
17708 #define _DRV_USART_InterruptSourceDisable( source ) false
17709 #define _DRV_USART_InterruptSourceStatusClear( source ) SYS_INT_SourceStatusClear ( source )
17710 #define _DRV_USART_SEM_POST( x ) OSAL_SEM_Post ( x )
17711 #define _DRV_USART_TAKE_MUTEX( x , y ) OSAL_MUTEX_Lock ( x , y )
17712 #define _DRV_USART_RELEASE_MUTEX( x ) OSAL_MUTEX_Unlock ( x )
17713 #define _SYS_DMA_ChannelForceStart( channelHandle ) SYS_DMA_ChannelForceStart ( channelHandle )
17714  /* This means the driver is being built in a baremetal application.
17715  We cannot let a client open the driver in blocking mode */
17716 #define _DRV_USART_ALWAYS_NON_BLOCKING ( DRV_IO_INTENT_NONBLOCKING )
17717 // *****************************************************************************
17718 // *****************************************************************************
17719 // Section: Buffer Queue support
17720 // *****************************************************************************
17721 // *****************************************************************************
17722 /* Mapping of macros for buffer queue support
17723 */
17724  /* We dont need buffer queues or byte model support */
17725 #define _DRV_USART_TRANSMIT_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteTransmitTasks ( x )
17726 #define _DRV_USART_RECEIVE_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteReceiveTasks ( x )
17727 #define _DRV_USART_ERROR_TASKS( x ) _DRV_USART_ByteErrorTasks ( x )
17728 #define _DRV_USART_CLIENT_BUFFER_QUEUE_OBJECTS_REMOVE( x ) true
17729 #define _DRV_USART_ByteModelInterruptSourceEnable( source )
17730 // *****************************************************************************
17731 // *****************************************************************************
17732 // Initializtion Parameter Static Overrides
17733 // *****************************************************************************
17734 // *****************************************************************************
17735  //_DRV_USART_FEATURE_MAPPING_H
17736 /*******************************************************************************
17737  End of File
17738 */
17739 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h*/
17740 /* CLOSE_FILE Include File */
17741 
17742 #include "system/clk/sys_clk.h"
17743 #include "system/int/sys_int.h"
17744 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h */
17745 /*******************************************************************************
17746  Debug System Services Library Header
17747  Company:
17748  Microchip Technology Inc.
17749 
17750  File Name:
17751  sys_debug.h
17752  Summary:
17753  Defines the common debug definitions and interfaces used by MPLAB Harmony
17754  libraries to report errors and debug information to the user.
17755  Description:
17756  This header file defines the common debug definitions and interface macros
17757  (summary below) and prototypes used by MPLAB Harmony libraries to report
17758  errors and debug information to the user.
17759  *******************************************************************************/
17760 //DOM-IGNORE-BEGIN
17761 /*******************************************************************************
17762 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
17763 Microchip licenses to you the right to use, modify, copy and distribute
17764 Software only when embedded on a Microchip microcontroller or digital signal
17765 controller that is integrated into your product or third party product
17766 (pursuant to the sublicense terms in the accompanying license agreement).
17767 You should refer to the license agreement accompanying this Software for
17768 additional information regarding your rights and obligations.
17769 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17770 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17771 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17772 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17773 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17774 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17775 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17776 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17777 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17778 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17779  *******************************************************************************/
17780 //DOM-IGNORE-END
17781 #ifndef _SYS_DEBUG_H
17782 #define _SYS_DEBUG_H
17783 #include "C:\microchip\harmony\v2_06\framework\system\system.h"
17784  /* LDRA full path */
17785 // This should be defined in system_config.h. It is added here as a build safe-guard.
17786 #define SYS_DEBUG_BUFFER_DMA_READY
17787 // *****************************************************************************
17788 // *****************************************************************************
17789 // Section: SYS DEBUG Data Types
17790 // *****************************************************************************
17791 // *****************************************************************************
17792 // *****************************************************************************
17793 /* SYS_ERROR_LEVEL enumeration
17794  Summary:
17795  System error message priority levels.
17796  Description:
17797  This enumeration defines the supported system error message priority values.
17798  Remarks:
17799  Used by debug message macros to compare individual message priority against
17800  a global system-wide error message priority level to determine if an
17801  individual message should be displayed.
17802 */
17803 
17804 typedef
17805  enum
17806  {
17807  /* Errors that have the potential to cause a system crash. */
17809  /* Errors that have the potential to cause incorrect behavior. */
17811  /* Warnings about potentially unexpected behavior or side effects. */
17813  /* Information helpful to understanding potential errors and warnings. */
17815  /* Verbose information helpful during debugging and testing. */
17817  } SYS_ERROR_LEVEL ;
17818 // DOM-IGNORE-BEGIN
17819 // *****************************************************************************
17820 /* Do not use this variable directly. Use SYS_DEBUG_ErrorLevelGet or
17821  SYS_DEBUG_ErrorLevelSet functions to access this value.
17822 */
17823 
17824 extern SYS_ERROR_LEVEL
17825  gblErrLvl ;
17826 // DOM-IGNORE-END
17827 // *****************************************************************************
17828 /* SYS Debug Module Index Number
17829  Summary:
17830  Debug System Service index.
17831  Description:
17832  This constant defines a symbolic name for the debug system service index.
17833  Remarks:
17834  There can only be a single debug system service instance in the system.
17835 */
17836 #define SYS_DEBUG_INDEX_0 0
17837 // *****************************************************************************
17838 /* SYS Debug Initialize structure
17839  Summary:
17840  Defines the data required to initialize the debug system service.
17841  Description:
17842  This structure defines the data required to initialize the debug system
17843  service.
17844  Remarks:
17845  None.
17846 */
17847 
17848 typedef
17849  struct
17850  {
17851  /* System module initialization */
17852  SYS_MODULE_INIT moduleInit ;
17853  /* Initial system error level setting. */
17854  SYS_ERROR_LEVEL errorLevel ;
17855  /* Console index to receive debug messages */
17856  SYS_MODULE_INDEX consoleIndex ;
17857  } SYS_DEBUG_INIT ;
17858 // *****************************************************************************
17859 // *****************************************************************************
17860 // Section: SYS DEBUG Functions
17861 // *****************************************************************************
17862 // *****************************************************************************
17863 // *****************************************************************************
17864 /* Function:
17865  SYS_MODULE_OBJ SYS_DEBUG_Initialize( const SYS_MODULE_INDEX index,
17866  const SYS_MODULE_INIT * const init )
17867  Summary:
17868  Initializes the global error level and specific module instance.
17869  Description:
17870  This function initializes the global error level. It also initializes any
17871  internal system debug module data structures.
17872  Precondition:
17873  None.
17874  Parameters:
17875  index - Index for the instance to be initialized
17876  init - Pointer to a data structure containing any data necessary
17877  to initialize the debug service. This pointer may be null
17878  if no data is required because static overrides have
17879  been provided.
17880  Returns:
17881  If successful, returns a valid handle to an object. Otherwise, it
17882  returns SYS_MODULE_OBJ_INVALID.
17883  Example:
17884  <code>
17885  SYS_MODULE_OBJ objectHandle;
17886  SYS_DEBUG_INIT debugInit =
17887  {
17888  .moduleInit = {0},
17889  .errorLevel = SYS_ERROR_DEBUG,
17890  };
17891  objectHandle = SYS_Debug_Initialize (SYS_DEBUG_CONSOLE, (SYS_MODULE_INIT*)&debugInit);
17892  if (SYS_MODULE_OBJ_INVALID == objectHandle)
17893  {
17894  // Handle error
17895  }
17896  </code>
17897  Remarks:
17898  This routine should only be called once during system initialization. If the
17899  system was already initialized it safely returns without causing any disturbance.
17900 */
17901 
17902 SYS_MODULE_OBJ
17904  const SYS_MODULE_INDEX index ,
17905  const SYS_MODULE_INIT * const init ) ;
17906 // *****************************************************************************
17907 /* Function:
17908  void SYS_DEBUG_Reinitialize( SYS_MODULE_OBJ object,
17909  const SYS_MODULE_INIT * const init )
17910  Summary:
17911  Reinitializes and refreshes the data structure for the instance of the
17912  Debug module.
17913  Description:
17914  This function reinitializes and refreshes the data structure for the instance
17915  of the Debug module using the supplied data.
17916  Precondition:
17917  The SYS_DEBUG_Initialize function should have been called before calling
17918  this function.
17919  Parameters:
17920  object - Identifies the SYS DEBUG Object returned by the Initialize
17921  interface
17922  init - Pointer to the data structure containing any data
17923  necessary to initialize the hardware
17924  Returns:
17925  None
17926  Example:
17927  <code>
17928  SYS_MODULE_OBJ objectHandle;
17929  // Populate the console initialization structure
17930  SYS_DEBUG_INIT dbgInit =
17931  {
17932  .moduleInit = {0},
17933  .errorLevel = SYS_ERROR_DEBUG,
17934  };
17935  SYS_DEBUG_Reinitialize (objectHandle, (SYS_MODULE_INIT*)&dbgInit);
17936  </code>
17937  Remarks:
17938  This operation uses the same initialization data structure as the
17939  SYS_DEBUG_Initialize operation. This function can be called multiple times
17940  to reinitialize the module.
17941 */
17942 
17943 void
17945  SYS_MODULE_OBJ object ,
17946  const SYS_MODULE_INIT * const init ) ;
17947 // *****************************************************************************
17948 /* Function:
17949  void SYS_DEBUG_Deinitialize( SYS_MODULE_OBJ object )
17950  Summary:
17951  Deinitializes the specific module instance of the Debug module.
17952  Description:
17953  This function deinitializes the specific module instance disabling its
17954  operation (and any hardware for driver modules). Resets all of the internal
17955  data structures and fields for the specified instance to the default settings.
17956  Precondition:
17957  The SYS_DEBUG_Initialize function should have been called before calling
17958  this function.
17959  Parameters:
17960  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17961  Returns:
17962  None.
17963  Example:
17964  <code>
17965  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17966  SYS_DEBUG_Deinitialize (object);
17967  </code>
17968  Remarks:
17969  Once the Initialize operation has been called, the Deinitialize
17970  operation must be called before the Initialize operation can be called
17971  again.
17972 */
17973 
17974 void
17976  SYS_MODULE_OBJ object ) ;
17977 // *****************************************************************************
17978 /* Function:
17979  void SYS_DEBUG_Tasks( SYS_MODULE_OBJ object )
17980  Summary:
17981  Maintains the debug module's state machine.
17982  Description:
17983  This function is used to maintain the debug module's internal state
17984  machine and implement its ISR for interrupt-driven implementations.
17985  Precondition:
17986  The SYS_DEBUG_Initialize function must have been called for the specified
17987  CONSOLE driver instance.
17988  Parameters:
17989  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17990  Returns:
17991  None.
17992  Example:
17993  <code>
17994  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17995  while (true)
17996  {
17997  SYS_DEBUG_Tasks (object);
17998  // Do other tasks
17999  }
18000  </code>
18001  Remarks:
18002  This function is normally not called directly by an application. It is
18003  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
18004  ISR.
18005 */
18006 
18007 void
18008  SYS_DEBUG_Tasks (
18009  SYS_MODULE_OBJ object ) ;
18010 // *****************************************************************************
18011 /* Function:
18012  SYS_STATUS SYS_DEBUG_Status( SYS_MODULE_OBJ object )
18013  Summary:
18014  Returns status of the specific instance of the debug service module.
18015  Description:
18016  This function returns the status of the specific debug service module
18017  instance.
18018  Precondition:
18019  The SYS_CONSOLE_Initialize function should have been called before calling
18020  this function.
18021  Parameters:
18022  object - Debug module object handle, returned from SYS_DEBUG_Initialize
18023  Returns:
18024  * SYS_STATUS_READY - Indicates that the module is running and
18025  ready to service requests. Any value greater
18026  than SYS_STATUS_READY is also a normal
18027  running state in which the module is ready
18028  to accept new operations.
18029  * SYS_STATUS_BUSY - Indicates that the module is busy with a
18030  previous system level operation and cannot
18031  start another.
18032  * SYS_STATUS_ERROR - Indicates that the module is in an error
18033  state. Any value less than SYS_STATUS_ERROR
18034  is also an error state.
18035  * SYS_STATUS_UNINITIALIZED - Indicates that the module has not been
18036  initialized or has been deinitialized.
18037  Example:
18038  <code>
18039  SYS_MODULE_OBJ object; // Returned from SYS_CONSOLE_Initialize
18040  SYS_STATUS debugStatus;
18041  debugStatus = SYS_DEBUG_Status (object);
18042  if (SYS_STATUS_ERROR >= debugStatus)
18043  {
18044  // Handle error
18045  }
18046  </code>
18047  Remarks:
18048  None.
18049 */
18050 
18051 SYS_STATUS
18053  SYS_MODULE_OBJ object ) ;
18054 // *****************************************************************************
18055 // *****************************************************************************
18056 // Section: SYS DEBUG Console Functions
18057 // *****************************************************************************
18058 // *****************************************************************************
18059 // *****************************************************************************
18060 /* Function:
18061  SYS_DEBUG_Message( const char* message );
18062  Summary:
18063  Prints a message to the console regardless of the system error level.
18064  Description:
18065  This function prints a message to the console regardless of the system
18066  error level. It can be used as an implementation of the SYS_MESSAGE and
18067  SYS_DEBUG_MESSAGE macros.
18068  Precondition:
18069  SYS_DEBUG_Initialize must have returned a valid object handle and the
18070  SYS_DEBUG_Tasks function must be called by the system to complete the
18071  message request.
18072  Parameters:
18073  message - Pointer to a message string to be displayed.
18074  Returns:
18075  None.
18076  Example:
18077  <code>
18078  // In system_config.h:
18079 #define SYS_MESSAGE(message) SYS_DEBUG_Message(message)
18080 
18081  // In source (.c) files:
18082  SYS_MESSAGE("My Message\n\r");
18083  </code>
18084  Remarks:
18085  Do not call this function directly. Call the SYS_MESSAGE or
18086  SYS_DEBUG_MESSAGE macros instead.
18087 
18088  The default SYS_MESSAGE and SYS_DEBUG_MESSAGE macro definitions remove
18089  the messages and message function calls from the source code. To access
18090  and utilize the messages, define the SYS_DEBUG_USE_CONSOLE macro or
18091  override the definitions of the individual macros.
18092 */
18093 
18094 void
18096  const char * message ) ;
18097 // *****************************************************************************
18098 /* Function:
18099  SYS_DEBUG_Print( const char* format, ... )
18100  Summary:
18101  Formats and prints a message with a variable number of arguments to the
18102  console regardless of the system error level.
18103  Description:
18104  This function formats and prints a message with a variable number of
18105  arguments to the console regardless of the system error level. It can be
18106  used to implement the SYS_PRINT and SYS_DEBUG_PRINT macros.
18107  Precondition:
18108  SYS_DEBUG_Initialize must have returned a valid object handle and the
18109  SYS_DEBUG_Tasks function must be called by the system to complete the
18110  message request.
18111  Parameters:
18112  format - Pointer to a buffer containing the format string for
18113  the message to be displayed.
18114  ... - Zero or more optional parameters to be formated as
18115  defined by the format string.
18116  Returns:
18117  None.
18118  Example:
18119  <code>
18120  // In system_config.h
18121 #define SYS_PRINT(format, ...) SYS_DEBUG_Print(format, ##__VA_ARG__)
18122 
18123  // In source code
18124  int result;
18125 
18126  result = SomeOperation();
18127  if (result > MAX_VALUE)
18128  {
18129  SYS_PRINT("Result of %d exceeds max value\r\n", result);
18130  }
18131  </code>
18132  Remarks:
18133  The format string and arguments follow the printf convention.
18134 
18135  Do not call this function directly. Call the SYS_PRINT or SYS_DEBUG_PRINT
18136  macros instead.
18137 
18138  The default SYS_PRINT and SYS_DEBUG_PRINT macro definitions remove the
18139  messages and message function calls. To access and utilize the messages,
18140  define the SYS_DEBUG_USE_CONSOLE macro or override the definitions of the
18141  individual macros.
18142 */
18143 
18144 void
18145  SYS_DEBUG_Print (
18146  const char * format ,
18147  ... ) ;
18148 // *****************************************************************************
18149 /* Function:
18150  void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level);
18151  Summary:
18152  Sets the global system error reporting level.
18153  Description:
18154  This function sets the global system error reporting level.
18155 
18156  Precondition:
18157  SYS_DEBUG_Initialize must have returned a valid object handle.
18158  Parameters:
18159  level - The desired system error level.
18160  Returns:
18161  None.
18162  Example:
18163  <code>
18164  SYS_DEBUG_ErrorLevelSet(SYS_ERROR_WARNING);
18165  </code>
18166  Remarks:
18167  None.
18168 */
18169 
18170 void
18172  SYS_ERROR_LEVEL level ) ;
18173 // *****************************************************************************
18174 /* Function:
18175  SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void);
18176  Summary:
18177  Returns the global system Error reporting level.
18178  Description:
18179  This function returns the global System Error reporting level.
18180 
18181  Precondition:
18182  SYS_DEBUG_Initialize must have returned a valid object handle.
18183  Parameters:
18184  None.
18185  Returns:
18186  The global System Error Level.
18187  Example:
18188  <code>
18189  SYS_ERROR_LEVEL level;
18190 
18191  level = SYS_DEBUG_ErrorLevelGet();
18192  </code>
18193  Remarks:
18194  None.
18195 */
18196 
18198  SYS_DEBUG_ErrorLevelGet ( void ) ;
18199 // *****************************************************************************
18200 // *****************************************************************************
18201 // Section: SYS DEBUG Macros
18202 // *****************************************************************************
18203 // *****************************************************************************
18204 // *****************************************************************************
18205 /* Macro:
18206  _SYS_DEBUG_MESSAGE( SYS_ERROR_LEVEL level, const char* message )
18207  Summary:
18208  Prints a debug message if the specified level is at or below the global
18209  system error level.
18210  Description:
18211  This macro prints a debug message if the specified level is at or below the
18212  global error level. It can be used to implement the SYS_DEBUG_MESSAGE macro.
18213  Precondition:
18214  SYS_DEBUG_Initialize must have returned a valid object handle.
18215  Parameters:
18216  level - The current error level threshold for displaying the message.
18217  message - Pointer to a buffer containing the message to be displayed.
18218  Returns:
18219  None.
18220  Example:
18221  <code>
18222  // In system_config.h
18223 #define SYS_DEBUG_MESSAGE(level,message) _SYS_DEBUG_MESSAGE(level,message)
18224 
18225  // In library source (.c) code.
18226  SYS_DEBUG_MESSAGE(SYS_ERROR_WARNING, "My debug warning message\n\r");
18227  </code>
18228  Remarks:
18229  Do not call this macro directly. Call the SYS_DEBUG_MESSAGE macro instead.
18230 
18231  The default SYS_DEBUG_MESSAGE macro definition removes the message and
18232  function call from the source code. To access and utilize the message,
18233  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
18234  SYS_DEBUG_MESSAGE macro.
18235 */
18236 #define _SYS_DEBUG_MESSAGE( level , message ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Message ( message ) ; } while ( 0 )
18237 // *****************************************************************************
18238 /* Macro:
18239  _SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
18240  Summary:
18241  Formats and prints a debug message if the specified level is at or below the
18242  global system error level.
18243  Description:
18244  This function formats and prints a debug message if the specified level is
18245  at or below the global system error level. It can be used to implement the
18246  SYS_DEBUG_PRINT macro.
18247  Precondition:
18248  SYS_DEBUG_Initialize must have returned a valid object handle.
18249  Parameters:
18250  level - The current error level threshold for displaying the message.
18251  format - Pointer to a buffer containing the format string for
18252  the message to be displayed.
18253  ... - Zero or more optional parameters to be formated as
18254  defined by the format string.
18255  Returns:
18256  None.
18257  Example:
18258  <code>
18259  // In system_config.h
18260 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
18261 
18262  // In source code
18263  int result;
18264 
18265  result = SomeOperation();
18266  if (result > MAX_VALUE)
18267  {
18268  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
18269  // Take appropriate action
18270  }
18271  </code>
18272  Remarks:
18273  Do not call this macro directly. Call the SYS_DEBUG_PRINT macro instead.
18274 
18275  The default SYS_DEBUG_PRINT macro definition removes the message and
18276  function call from the source code. To access and utilize the message,
18277  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
18278  SYS_DEBUG_PRINT macro.
18279 */
18280 #define _SYS_DEBUG_PRINT( level , format ,... ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Print ( format , ## __VA_ARGS__ ) ; } while ( 0 )
18281 // DOM-IGNORE-BEGIN
18282 // *****************************************************************************
18283 /* These definitions support the SYS_DEBUG_USE_CONSOLE build-time configuration
18284  option. Defining SYS_DEBUG_USE_CONSOLE in the system configuration
18285  (system_config.h) will map the macros below to the appropriate system
18286  console functions.
18287 */
18288 // DOM-IGNORE-END
18289 // *****************************************************************************
18290 /* Macro:
18291  SYS_MESSAGE( const char* message )
18292  Summary:
18293  Prints a message to the console regardless of the system error level.
18294  Description:
18295  This macro is used to print a message to the console regardless of the
18296  system error level. It can be mapped to any desired implementation.
18297  Precondition:
18298  If mapped to the _SYS_MESSAGE function, then the system debug service must
18299  be initialized and running.
18300  Parameters:
18301  message - Pointer to a buffer containing the message string to be
18302  displayed.
18303  Returns:
18304  None.
18305  Example:
18306  <code>
18307  // In system_config.h:
18308 #define SYS_MESSAGE(message) _SYS_MESSAGE(message)
18309 
18310  // In source (.c) files:
18311  SYS_MESSAGE("My Message\n\r");
18312  </code>
18313  Remarks:
18314  By default, this macro is defined as nothing, effectively removing all code
18315  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
18316  defined in a way that maps calls to it to the desired implementation (see
18317  example, above).
18318 
18319  This macro can be mapped to the system console service (along with other
18320  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18321  configuration (system_config.h) instead of defining it individually.
18322 */
18323 #define SYS_MESSAGE( message )
18324 // *****************************************************************************
18325 /* Function:
18326  SYS_DEBUG_MESSAGE( const char* message )
18327  Summary:
18328  Prints a debug message if the system error level is defined defined at
18329  or lower than the level specified.
18330  Description:
18331  This function prints a debug message if the system error level is defined at
18332  or lower than the level specified.
18333  Precondition:
18334  SYSTEM_CURRENT_ERROR_LEVEL must be defined as SYS_ERROR_DEBUG.
18335  Parameters:
18336  level - The current error level threshold for displaying the message.
18337  message - Pointer to a buffer containing the message to be displayed.
18338  Returns:
18339  None.
18340  Example:
18341  <code>
18342 #define SYS_DEBUG_MESSAGE _SYS_DEBUG_MESSAGE
18343  SYS_ERROR_LevelSet(SYS_ERROR_DEBUG);
18344  SYS_DEBUG_MESSAGE("System Debug Message \n\r");
18345  </code>
18346  Remarks:
18347  By default, this macro is defined as nothing, effectively removing all code
18348  generated by calls to it. To process SYS_DEBUG_MESSAGE calls, this macro
18349  must be defined in a way that maps calls to it to the desired implementation
18350  (see example, above).
18351 
18352  This macro can be mapped to the system console service (along with other
18353  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18354  configuration (system_config.h) instead of defining it individually.
18355 */
18356 #define SYS_DEBUG_MESSAGE( level , message )
18357 // *****************************************************************************
18358 /* Function:
18359  SYS_PRINT(const char* format, ...);
18360  Summary:
18361  Formats and prints an error message with a variable number of arguments
18362  regardless of the system error level.
18363  Description:
18364  This function formats and prints an error message with a variable number of
18365  if the system error level is defined at or lower than the level specified.
18366  Precondition:
18367  SYSTEM_CURRENT_ERROR_LEVEL must be defined.
18368  Parameters:
18369  format - Pointer to a buffer containing the format string for
18370  the message to be displayed.
18371  ... - Zero or more optional parameters to be formated as
18372  defined by the format string.
18373  Returns:
18374  None.
18375  Example:
18376  <code>
18377  // In system_config.h
18378 #define SYS_PRINT(format, ...) _SYS_DEBUG_PRINT(format, ##__VA_ARG__)
18379 
18380  // In source code
18381  int result;
18382 
18383  result = SomeOperation();
18384  if (result > MAX_VALUE)
18385  {
18386  SYS_PRINT("Result of %d exceeds max value\r\n", result);
18387  // Take appropriate action
18388  }
18389  </code>
18390  Remarks:
18391  The format string and arguments follow the printf convention. This function
18392  is called by the macros SYS_PRINT and SYS_ERROR_PRINT
18393 
18394  By default, this macro is defined as nothing, effectively removing all code
18395  generated by calls to it. To process SYS_PRINT calls, this macro must be
18396  defined in a way that maps calls to it to the desired implementation (see
18397  example, above).
18398 
18399  This macro can be mapped to the system console service (along with other
18400  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18401  configuration (system_config.h) instead of defining it individually.
18402 */
18403 #define SYS_PRINT( fmt ,... )
18404 // *****************************************************************************
18405 /* Macro:
18406  SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
18407  Summary:
18408  Formats and prints an error message if the system error level is defined at
18409  or lower than the level specified.
18410  Description:
18411  This macro formats and prints an error message if the system error level
18412  is defined at or lower than the level specified.o
18413  Precondition:
18414  SYS_DEBUG_Initialize must have returned a valid object handle.
18415  Parameters:
18416  level - The current error level threshold for displaying the message.
18417  format - Pointer to a buffer containing the format string for
18418  the message to be displayed.
18419  ... - Zero or more optional parameters to be formated as
18420  defined by the format string.
18421  Returns:
18422  None.
18423  Example:
18424  <code>
18425  // In system_config.h
18426 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
18427 
18428  // In source code
18429  int result;
18430 
18431  result = SomeOperation();
18432  if (result > MAX_VALUE)
18433  {
18434  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
18435  // Take appropriate action
18436  }
18437  </code>
18438  Remarks:
18439  The format string and arguments follow the printf convention. This function
18440  is called by the macros SYS_PRINT and SYS_DEBUG_PRINT.
18441 
18442  By default, this macro is defined as nothing, effectively removing all code
18443  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
18444  defined in a way that maps calls to it to the desired implementation (see
18445  example, above).
18446 
18447  This macro can be mapped to the system console service (along with other
18448  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18449  configuration (system_config.h) instead of defining it individually.
18450 */
18451 #define SYS_DEBUG_PRINT( level , fmt ,... )
18452 // *****************************************************************************
18453 /* Macro:
18454  SYS_DEBUG_BreakPoint( void )
18455  Summary:
18456  Inserts a software breakpoint instruction when building in Debug mode.
18457  Description:
18458  This macro inserts a software breakpoint instruction when building in Debug
18459  mode.
18460  Precondition:
18461  None.
18462  Parameters:
18463  None.
18464  Returns:
18465  None.
18466  Example:
18467  <code>
18468  if (myDebugTestFailed)
18469  {
18470  SYS_DEBUG_BreakPoint();
18471  }
18472  </code>
18473  Remarks:
18474  Compiles out if not built for debugging.
18475 */
18476 #define SYS_DEBUG_BreakPoint( )
18477 // *****************************************************************************
18478 // *****************************************************************************
18479 // Section: SYS DEBUG Deprecated Macros
18480 // *****************************************************************************
18481 // *****************************************************************************
18482 /* Do not use these macros for new development.
18483 */
18484 //DOM-IGNORE-BEGIN
18485 #define SYS_DEBUG( level , message ) SYS_DEBUG_MESSAGE ( level , message )
18486 #define SYS_ERROR( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18487 #define SYS_ERROR_PRINT( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18488 //DOM-IGNORE-END
18489  // _SYS_DEBUG_H
18490 /*******************************************************************************
18491  End of File
18492 */
18493 #endif /*00 C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h*/
18494 /* CLOSE_FILE Include File */
18495 
18496 // DOM-IGNORE-BEGIN
18497 // DOM-IGNORE-END
18498 // *****************************************************************************
18499 // *****************************************************************************
18500 // Section: Data Type Definitions
18501 // *****************************************************************************
18502 // *****************************************************************************
18503 /* USART FIFO+RX(8+1) size */
18504 #define _DRV_USART_RX_DEPTH 9
18505 // *****************************************************************************
18506 /* USART Static Driver Instance Object
18507  Summary:
18508  Object used to keep any data required for the static USART driver.
18509  Description:
18510  This object is used to keep track of any data that must be maintained to
18511  manage the USART static driver.
18512  Remarks:
18513  None.
18514 */
18515 
18516 typedef
18517  struct
18518  {
18519  /* Client specific error */
18520  DRV_USART_ERROR error ;
18521  } DRV_USART_OBJ ;
18522 // *****************************************************************************
18523 // *****************************************************************************
18524 // Section: Local functions.
18525 // *****************************************************************************
18526 // *****************************************************************************
18527 // DOM-IGNORE-BEGIN
18528 // DOM-IGNORE-END
18529  //#ifndef _DRV_USART_STATIC_LOCAL_H
18530 /*******************************************************************************
18531  End of File
18532 */
18533 
18534 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h*/
18535 /* CLOSE_FILE Include File */
18536 
18537 // DOM-IGNORE-BEGIN
18538 // DOM-IGNORE-END
18539 // *********************************************************************************************
18540 // *********************************************************************************************
18541 // Section: System Interface Headers for the Instance 0 of USART static driver
18542 // *********************************************************************************************
18543 // *********************************************************************************************
18544 
18545 SYS_MODULE_OBJ
18546  DRV_USART0_Initialize ( void ) ;
18547 
18548 void
18549  DRV_USART0_Deinitialize ( void ) ;
18550 
18551 SYS_STATUS
18552  DRV_USART0_Status ( void ) ;
18553 
18554 void
18555  DRV_USART0_TasksTransmit ( void ) ;
18556 
18557 void
18558  DRV_USART0_TasksReceive ( void ) ;
18559 
18560 void
18561  DRV_USART0_TasksError ( void ) ;
18562 // *********************************************************************************************
18563 // *********************************************************************************************
18564 // Section: General Client Interface Headers for the Instance 0 of USART static driver
18565 // *********************************************************************************************
18566 // *********************************************************************************************
18567 
18568 DRV_HANDLE
18569  DRV_USART0_Open (
18570  const SYS_MODULE_INDEX index ,
18571  const DRV_IO_INTENT ioIntent ) ;
18572 
18573 void
18574  DRV_USART0_Close ( void ) ;
18575 
18577  DRV_USART0_ClientStatus ( void ) ;
18578 
18580  DRV_USART0_TransferStatus ( void ) ;
18581 
18583  DRV_USART0_ErrorGet ( void ) ;
18584 // *********************************************************************************************
18585 // *********************************************************************************************
18586 // Section: Byte Model Client Interface Headers for the Instance 0 of USART static driver
18587 // *********************************************************************************************
18588 // *********************************************************************************************
18589 
18590 uint8_t
18591  DRV_USART0_ReadByte ( void ) ;
18592 
18593 void
18595  const uint8_t byte ) ;
18596 
18597 unsigned int
18599 
18600 unsigned int
18602 
18603 bool
18605 
18606 bool
18608 // *********************************************************************************************
18609 // *********************************************************************************************
18610 // Section: Set up Client Interface Headers for the Instance 0 of USART static driver
18611 // *********************************************************************************************
18612 // *********************************************************************************************
18613 
18616  uint32_t baud ) ;
18617 
18620  DRV_USART_LINE_CONTROL lineControlMode ) ;
18621 // DOM-IGNORE-BEGIN
18622 // DOM-IGNORE-END
18623  // #ifndef _DRV_USART_STATIC_H
18624 /*******************************************************************************
18625  End of File
18626 */
18627 
18628 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h*/
18629 /* CLOSE_FILE Include File */
18630 
18631 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h */
18632 /*******************************************************************************
18633  Ports System Service Interface Definition
18634  Company:
18635  Microchip Technology Inc.
18636  File Name:
18637  sys_ports.h
18638  Summary:
18639  Ports System Service interface definitions
18640  Description:
18641  This file contains the interface definition for the Ports system
18642  service. It provides a way to interact with the Ports subsystem to
18643  manage the timing requests supported by the system
18644 *******************************************************************************/
18645 //DOM-IGNORE-BEGIN
18646 /*******************************************************************************
18647 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18648 Microchip licenses to you the right to use, modify, copy and distribute
18649 Software only when embedded on a Microchip microcontroller or digital signal
18650 controller that is integrated into your product or third party product
18651 (pursuant to the sublicense terms in the accompanying license agreement).
18652 You should refer to the license agreement accompanying this Software for
18653 additional information regarding your rights and obligations.
18654 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18655 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18656 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18657 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18658 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18659 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18660 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18661 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18662 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18663 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18664 *******************************************************************************/
18665 //DOM-IGNORE-END
18666 #ifndef _SYS_PORTS_H
18667 #define _SYS_PORTS_H
18668 // *****************************************************************************
18669 // *****************************************************************************
18670 // Section: Included Files
18671 // *****************************************************************************
18672 // *****************************************************************************
18673 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h */
18674 /*******************************************************************************
18675  PORTS System Service Library Interface Definition
18676  Company:
18677  Microchip Technology Inc.
18678  File Name:
18679  sys_ports_definitions.h
18680  Summary:
18681  PORTS System Service data type definitions header.
18682  Description:
18683  This file contains data type definitions header.
18684 *******************************************************************************/
18685 //DOM-IGNORE-BEGIN
18686 /*******************************************************************************
18687 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18688 Microchip licenses to you the right to use, modify, copy and distribute
18689 Software only when embedded on a Microchip microcontroller or digital signal
18690 controller that is integrated into your product or third party product
18691 (pursuant to the sublicense terms in the accompanying license agreement).
18692 You should refer to the license agreement accompanying this Software for
18693 additional information regarding your rights and obligations.
18694 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18695 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18696 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18697 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18698 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18699 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18700 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18701 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18702 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18703 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18704 *******************************************************************************/
18705 //DOM-IGNORE-END
18706 #ifndef _SYS_PORTS_DEFINITIONS_H
18707 #define _SYS_PORTS_DEFINITIONS_H
18708 // *****************************************************************************
18709 // *****************************************************************************
18710 // Section: File includes
18711 // *****************************************************************************
18712 // *****************************************************************************
18713 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
18714 #include "system/common/sys_common.h"
18715 #include "system/common/sys_module.h"
18716 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h */
18717 /*******************************************************************************
18718  Ports Peripheral Library Interface Header
18719  Company:
18720  Microchip Technology Inc.
18721  File Name:
18722  plib_ports.h
18723  Summary:
18724  Ports Peripheral Library Interface header for Ports function definitions.
18725  Description:
18726  This header file contains the function prototypes and definitions of
18727  the data types and constants that make up the interface to the Ports
18728  Peripheral Library for all families of Microchip microcontrollers. The
18729  definitions in this file are common to the Ports peripheral.
18730 *******************************************************************************/
18731 // DOM-IGNORE-BEGIN
18732 /*******************************************************************************
18733 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
18734 Microchip licenses to you the right to use, modify, copy and distribute
18735 Software only when embedded on a Microchip microcontroller or digital signal
18736 controller that is integrated into your product or third party product
18737 (pursuant to the sublicense terms in the accompanying license agreement).
18738 You should refer to the license agreement accompanying this Software for
18739 additional information regarding your rights and obligations.
18740 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18741 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18742 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18743 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18744 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18745 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18746 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18747 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18748 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18749 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18750 *******************************************************************************/
18751 // DOM-IGNORE-END
18752 #ifndef _PLIB_PORTS_H
18753 #define _PLIB_PORTS_H
18754 #include <stdint.h>
18755 #include <stddef.h>
18756 // DOM-IGNORE-BEGIN
18757 // DOM-IGNORE-END
18758 // *****************************************************************************
18759 // *****************************************************************************
18760 // Section: Constants & Data Types
18761 // *****************************************************************************
18762 // *****************************************************************************
18763 // *****************************************************************************
18764 /* Ports data mask definition
18765  Summary:
18766  Data type defining the Ports data mask
18767  Description:
18768  This data type defines the Ports data mask
18769  Remarks:
18770  None.
18771 */
18772 
18773 typedef
18774 uint16_t
18776 // *****************************************************************************
18777 /* Ports data type definition
18778  Summary:
18779  Data type defining the Ports data type.
18780  Description:
18781  This data type defines the Ports data type.
18782  Remarks:
18783  None.
18784 */
18785 
18786 typedef
18787 uint32_t
18789 // *****************************************************************************
18790 // *****************************************************************************
18791 // Section: Included Files (continued at end of file)
18792 // *****************************************************************************
18793 // *****************************************************************************
18794 /* This section lists the other files that are included in this file. However,
18795  please see the end of the file for additional implementation header files
18796  that are also included.
18797 */
18798 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h */
18799 //DOM-IGNORE-BEGIN
18800 /*******************************************************************************
18801 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
18802 Microchip licenses to you the right to use, modify, copy and distribute
18803 Software only when embedded on a Microchip microcontroller or digital signal
18804 controller that is integrated into your product or third party product
18805 (pursuant to the sublicense terms in the accompanying license agreement).
18806 You should refer to the license agreement accompanying this Software for
18807 additional information regarding your rights and obligations.
18808 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
18809 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18810 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18811 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18812 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18813 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18814 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18815 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18816 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18817 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18818  *******************************************************************************/
18819 //DOM-IGNORE-END
18820 #ifndef _PLIB_PORTS_PROCESSOR_H
18821 #define _PLIB_PORTS_PROCESSOR_H
18822 #error "Can't find header"
18823 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h*/
18824 /* CLOSE_FILE Include File */
18825 
18826 // *****************************************************************************
18827 // *****************************************************************************
18828 // Section: Ports Peripheral Library Interface Routines
18829 // *****************************************************************************
18830 // *****************************************************************************
18831 // *****************************************************************************
18832 /* Function:
18833  void PLIB_PORTS_RemapInput( PORTS_MODULE_ID index,
18834  PORTS_REMAP_INPUT_FUNCTION inputFunction,
18835  PORTS_REMAP_INPUT_PIN remapInputPin );
18836  Summary:
18837  Input function remapping.
18838  Description:
18839  This function controls the Input function remapping. It allows user to map
18840  any of the input functionality on any of the remappable input pin.
18841  This function does not perform atomic register access.
18842  Precondition:
18843  IOLOCK bit of configuration register should be clear to allow any remapping.
18844  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18845  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18846  find more information.
18847  Parameters:
18848  index - Identifier for the device instance to be configured
18849  inputFunction - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
18850  remapInputPin - One of the possible values of PORTS_REMAP_INPUT_PIN
18851  Returns:
18852  None.
18853  Example:
18854  <code>
18855 
18856  // System Unlock
18857  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18858  // Unlock PPS registers
18859  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18860  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
18861  PLIB_PORTS_RemapInput(PORTS_ID_0, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
18862  </code>
18863  Remarks:
18864  This feature may not be available on all devices. Please refer to the
18865  specific device data sheet to determine availability or use
18866  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18867  this feature is available.
18868 */
18869 
18870 void
18872  PORTS_MODULE_ID index ,
18873  PORTS_REMAP_INPUT_FUNCTION inputFunction ,
18874  PORTS_REMAP_INPUT_PIN remapInputPin ) ;
18875 // *****************************************************************************
18876 /* Function:
18877  void PLIB_PORTS_RemapOutput( PORTS_MODULE_ID index,
18878  PORTS_REMAP_OUTPUT_FUNCTION outputFunction,
18879  PORTS_REMAP_OUTPUT_PIN remapOutputPin );
18880  Summary:
18881  Output function remapping.
18882  Description:
18883  This function controls the Output function remapping. it allows user to map
18884  any of the output functionality on any of the remappable output pin.
18885  This function does not perform atomic register access.
18886  Precondition:
18887  IOLOCK bit of configuration register should be clear to allow any remapping.
18888  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18889  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18890  find more information.
18891  Parameters:
18892  index - Identifier for the device instance to be configured
18893  outputFunction - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
18894  remapOutputPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
18895  Returns:
18896  None.
18897  Example:
18898  <code>
18899 
18900  // System Unlock
18901  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18902  // Unlock PPS registers
18903  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18904  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
18905  PLIB_PORTS_RemapOutput(PORTS_ID_0, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
18906 
18907  </code>
18908  Remarks:
18909  This feature may not be available on all devices. Please refer to the
18910  specific device data sheet to determine availability or use
18911  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18912  this feature is available.
18913 */
18914 
18915 void
18917  PORTS_MODULE_ID index ,
18918  PORTS_REMAP_OUTPUT_FUNCTION outputFunction ,
18919  PORTS_REMAP_OUTPUT_PIN remapOutputPin ) ;
18920 // *****************************************************************************
18921 /* Function:
18922  void PLIB_PORTS_PinModeSelect( PORTS_MODULE_ID index,
18923  PORTS_ANALOG_PIN pin,
18924  PORTS_PIN_MODE mode );
18925  Summary:
18926  Enables the selected pin as analog or digital.
18927  Description:
18928  This function enables the selected pin as analog or digital.
18929  This function does not perform atomic register access.
18930  Precondition:
18931  None.
18932  Parameters:
18933  index - Identifier for the device instance to be configured
18934  pin - Possible values of PORTS_ANALOG_PIN
18935  mode - Possible values of PORTS_PIN_MODE
18936  Returns:
18937  None.
18938  Example:
18939  <code>
18940 
18941  // Make AN0 pin as Analog
18942  PLIB_PORTS_PinModeSelect(PORTS_ID_0, PORTS_ANALOG_PIN_0, PORTS_PIN_MODE_ANALOG);
18943 
18944  </code>
18945  Remarks:
18946  This feature may not be available on all devices. Please refer to the
18947  specific device data sheet to determine availability or use
18948  PLIB_PORTS_ExistsPinMode in your application to determine whether
18949  this feature is available.
18950 */
18951 
18952 void
18954  PORTS_MODULE_ID index ,
18955  PORTS_ANALOG_PIN pin ,
18956  PORTS_PIN_MODE mode ) ;
18957 // *****************************************************************************
18958 /* Function:
18959  void PLIB_PORTS_PinModePerPortSelect( PORTS_MODULE_ID index,
18960  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos,
18961  PORTS_PIN_MODE mode );
18962  Summary:
18963  Enables the selected port pin as analog or digital.
18964  Description:
18965  This function enables the selected port pin as analog or digital.
18966  This function does not perform atomic register access.
18967  Precondition:
18968  None.
18969  Parameters:
18970  index - Identifier for the device instance to be configured
18971  channel - Port pin channel
18972  bitPos - Position in the PORT pins
18973  mode - Possible values of PORTS_PIN_MODE
18974  Returns:
18975  None.
18976  Example:
18977  <code>
18978 
18979  // Make RC5 pin Analog
18980  PLIB_PORTS_PinModePerPortSelect(PORTS_ID_0, PORT_CHANNEL_C,
18981  PORTS_BIT_POS_5, PORTS_PIN_MODE_ANALOG);
18982 
18983  </code>
18984  Remarks:
18985  This function is only available in devices with PPS. For Non-PPS devices, use the
18986  PLIB_PORTS_PinModeSelect function.
18987 
18988  This feature may not be available on all devices. Please refer to the
18989  specific device data sheet to determine availability or use
18990  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
18991  this feature is available.
18992 */
18993 
18994 void
18996  PORTS_MODULE_ID index ,
18997  PORTS_CHANNEL channel ,
18998  PORTS_BIT_POS bitPos ,
18999  PORTS_PIN_MODE mode ) ;
19000 // *****************************************************************************
19001 /* Function:
19002  void PLIB_PORTS_ChangeNoticePullDownPerPortEnable( PORTS_MODULE_ID index,
19003  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
19004  Summary:
19005  Enables the pull-down for selected Change Notice pins.
19006  Description:
19007  This function enables the pull-down for selected Change Notice pins.
19008  This function does not perform atomic register access.
19009  Precondition:
19010  None.
19011  Parameters:
19012  index - Identifier for the device instance to be configured
19013  channel - Port pin channel
19014  bitPos - Position in the PORT pins
19015  Returns:
19016  None.
19017  Example:
19018  <code>
19019 
19020  // Enable pull-down for RC5 pin
19021  PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
19022  PORTS_BIT_POS_5);
19023 
19024  </code>
19025  Remarks:
19026  This feature may not be available on all devices. Please refer to the
19027  specific device data sheet to determine availability or use
19028  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
19029  determine whether this feature is available.
19030 */
19031 
19032 void
19034  PORTS_MODULE_ID index ,
19035  PORTS_CHANNEL channel ,
19036  PORTS_BIT_POS bitPos ) ;
19037 // *****************************************************************************
19038 /* Function:
19039  void PLIB_PORTS_ChangeNoticePullDownPerPortDisable( PORTS_MODULE_ID index,
19040  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
19041  Summary:
19042  Disables the pull-down for selected Change Notice pins.
19043  Description:
19044  This function disables the pull-down for selected Change Notice pins.
19045  This function does not perform atomic register access.
19046  Precondition:
19047  None.
19048  Parameters:
19049  index - Identifier for the device instance to be configured
19050  channel - Port pin channel
19051  bitPos - Position in the PORT pins
19052  Returns:
19053  None.
19054  Example:
19055  <code>
19056 
19057  // Disable pull-down for RC5 pin
19058  PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
19059  PORTS_BIT_POS_5);
19060  </code>
19061  Remarks:
19062  This feature may not be available on all devices. Please refer to the
19063  specific device data sheet to determine availability or use
19064  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
19065  determine whether this feature is available.
19066 */
19067 
19068 void
19070  PORTS_MODULE_ID index ,
19071  PORTS_CHANNEL channel ,
19072  PORTS_BIT_POS bitPos ) ;
19073 // *****************************************************************************
19074 /* Function:
19075  void PLIB_PORTS_ChangeNoticePullUpPerPortEnable ( PORTS_MODULE_ID index,
19076  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
19077  Summary:
19078  Enables the pull-up for selected Change Notice pins.
19079  Description:
19080  This function enables the pull-up for selected Change Notice pins.
19081  This function does not perform atomic register access.
19082  Precondition:
19083  None.
19084  Parameters:
19085  index - Identifier for the device instance to be configured
19086  channel - Port pin channel
19087  bitPos - Position in the PORT pins
19088  Returns:
19089  None.
19090  Example:
19091  <code>
19092 
19093  // Enable pull-up for RC5 pin
19094  PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
19095  PORTS_BIT_POS_5);
19096  </code>
19097  Remarks:
19098  This function is only available in devices with PPS. For Non-PPS devices, use the
19099  PLIB_PORTS_ChangeNoticePullUpEnable function.
19100 
19101  This feature may not be available on all devices. Please refer to the
19102  specific device data sheet to determine availability or use
19103  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19104  determine whether this feature is available.
19105 */
19106 
19107 void
19109  PORTS_MODULE_ID index ,
19110  PORTS_CHANNEL channel ,
19111  PORTS_BIT_POS bitPos ) ;
19112 // *****************************************************************************
19113 /* Function:
19114  void PLIB_PORTS_ChangeNoticePullUpPerPortDisable( PORTS_MODULE_ID index,
19115  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
19116  Summary:
19117  Disables weak pull-up for the selected pin.
19118  Description:
19119  This function disables weak pull-up for the selected port pin.
19120  This function does not perform atomic register access.
19121  Precondition:
19122  None.
19123  Parameters:
19124  index - Identifier for the device instance to be configured
19125  channel - Port pin channel
19126  bitPos - Position in the PORT pins
19127  Returns:
19128  None.
19129  Example:
19130  <code>
19131 
19132  // Disable pull-up for RC5 pin
19133  PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
19134  PORTS_BIT_POS_5);
19135 
19136  </code>
19137  Remarks:
19138  This function is only available in devices with PPS. For Non-PPS devices, use the
19139  PLIB_PORTS_ChangeNoticePullUpDisable function.
19140 
19141  Pull-ups on change notification pins should always be disabled when the
19142  port pin is configured as a digital output.
19143 
19144  This feature may not be available on all devices. Please refer to the
19145  specific device data sheet to determine availability or use
19146  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19147  determine whether this feature is available.
19148 */
19149 
19150 void
19152  PORTS_MODULE_ID index ,
19153  PORTS_CHANNEL channel ,
19154  PORTS_BIT_POS bitPos ) ;
19155 // *****************************************************************************
19156 /* Function:
19157  void PLIB_PORTS_PinChangeNoticePerPortEnable ( PORTS_MODULE_ID index,
19158  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
19159  Summary:
19160  Enables CN interrupt for the selected pin.
19161  Description:
19162  This function enables Change Notice interrupt for the selected port pin.
19163  This function does not perform atomic register access.
19164 
19165  Precondition:
19166  None.
19167  Parameters:
19168  index - Identifier for the device instance to be configured
19169  channel - Port pin channel
19170  bitPos - Position in the PORT pins
19171  Returns:
19172  None.
19173  Example:
19174  <code>
19175 
19176  // Enable CN interrupt for RC5 pin
19177  PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
19178  PORTS_BIT_POS_5);
19179 
19180  </code>
19181  Remarks:
19182  This function is only available in devices with PPS. For Non-PPS devices, use the
19183  PLIB_PORTS_PinChangeNoticeEnable function.
19184 
19185  This feature may not be available on all devices. Please refer to the
19186  specific device data sheet to determine availability or use
19187  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
19188  determine whether this feature is available.
19189 */
19190 
19191 void
19193  PORTS_MODULE_ID index ,
19194  PORTS_CHANNEL channel ,
19195  PORTS_BIT_POS bitPos ) ;
19196 // *****************************************************************************
19197 /* Function:
19198  void PLIB_PORTS_PinChangeNoticePerPortDisable( PORTS_MODULE_ID index,
19199  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
19200  Summary:
19201  Disables CN interrupt for the selected pin.
19202  Description:
19203  This function disables Change Notice interrupt for the selected port pin.
19204  This function does not perform atomic register access.
19205  Precondition:
19206  None.
19207  Parameters:
19208  index - Identifier for the device instance to be configured
19209  channel - Port pin channel
19210  bitPos - Position in the PORT pins
19211  Returns:
19212  None.
19213  Example:
19214  <code>
19215 
19216  // Disable CN interrupt for RC5 pin
19217  PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
19218  PORTS_BIT_POS_5);
19219 
19220  </code>
19221  Remarks:
19222  This function is only available in devices with PPS. For Non-PPS devices, use the
19223  PLIB_PORTS_PinChangeNoticeDisable function.
19224 
19225  This feature may not be available on all devices. Please refer to the
19226  specific device data sheet to determine availability or use
19227  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
19228  determine whether this feature is available.
19229 */
19230 
19231 void
19233  PORTS_MODULE_ID index ,
19234  PORTS_CHANNEL channel ,
19235  PORTS_BIT_POS bitPos ) ;
19236 // *****************************************************************************
19237 /* Function:
19238  void PLIB_PORTS_ChangeNoticePerPortTurnOn ( PORTS_MODULE_ID index,
19239  PORTS_CHANNEL channel );
19240  Summary:
19241  Enables the change notification for selected port.
19242  Description:
19243  This function enables the change notification for selected port.
19244  This function does not perform atomic register access.
19245  Precondition:
19246  None.
19247  Parameters:
19248  index - Identifier for the device instance to be configured
19249  channel - Port pin channel
19250  Returns:
19251  None.
19252  Example:
19253  <code>
19254  // Enable Change notification for Port C
19255  PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_ID_0, PORT_CHANNEL_C);
19256 
19257  </code>
19258  Remarks:
19259  This function is only available in devices with PPS. For Non-PPS devices, use the
19260  PLIB_PORTS_ChangeNoticeEnable function.
19261 
19262  This feature may not be available on all devices. Please refer to the
19263  specific device data sheet to determine availability or use
19264  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
19265  whether this feature is available.
19266 */
19267 
19268 void
19270  PORTS_MODULE_ID index ,
19271  PORTS_CHANNEL channel ) ;
19272 // *****************************************************************************
19273 /* Function:
19274  void PLIB_PORTS_ChangeNoticePerPortTurnOff( PORTS_MODULE_ID index,
19275  PORTS_CHANNEL channel );
19276  Summary:
19277  Disables the change notification for selected port.
19278  Description:
19279  This function disables the change notification for selected port.
19280  This function does not perform atomic register access.
19281  Precondition:
19282  None.
19283  Parameters:
19284  index - Identifier for the device instance to be configured
19285  channel - Port pin channel
19286  Returns:
19287  None.
19288  Example:
19289  <code>
19290  // Disable Change notification for Port C
19291  PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_ID_0, PORT_CHANNEL_C);
19292 
19293  </code>
19294  Remarks:
19295  This function is only available in devices with PPS. For Non-PPS devices, use the
19296  PLIB_PORTS_ChangeNoticeDisable function.
19297 
19298  This feature may not be available on all devices. Please refer to the
19299  specific device data sheet to determine availability or use
19300  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
19301  whether this feature is available.
19302 */
19303 
19304 void
19306  PORTS_MODULE_ID index ,
19307  PORTS_CHANNEL channel ) ;
19308 // *****************************************************************************
19309 /* Function:
19310  void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable ( PORTS_MODULE_ID index,
19311  PORTS_CHANNEL channel );
19312  Summary:
19313  Allows CN to be working in Idle mode for selected channel.
19314  Description:
19315  This function makes sure that change notification feature keeps working in
19316  Idle mode for the selected channel.
19317  This function does not perform atomic register access.
19318  Precondition:
19319  None.
19320  Parameters:
19321  index - Identifier for the device instance to be configured
19322  channel - Port pin channel
19323  Returns:
19324  None.
19325  Example:
19326  <code>
19327 
19328  // Change notification continues working in Idle mode for Port C
19329  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C);
19330 
19331  </code>
19332  Remarks:
19333  This function is only available in devices with PPS. For Non-PPS devices, use the
19334  PLIB_PORTS_ChangeNoticeInIdleEnable function.
19335 
19336  This feature may not be available on all devices. Please refer to the
19337  specific device data sheet to determine availability or use
19338  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
19339  whether this feature is available.
19340 */
19341 
19342 void
19344  PORTS_MODULE_ID index ,
19345  PORTS_CHANNEL channel ) ;
19346 // *****************************************************************************
19347 /* Function:
19348  void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable( PORTS_MODULE_ID index,
19349  PORTS_CHANNEL channel );
19350  Summary:
19351  Change Notification halts in Idle mode for selected channel.
19352  Description:
19353  This function makes sure that change notification feature halts in
19354  Idle mode for the selected channel.
19355  This function does not perform atomic register access.
19356  Precondition:
19357  None.
19358  Parameters:
19359  index - Identifier for the device instance to be configured
19360  channel - Port pin channel
19361  Returns:
19362  None.
19363  Example:
19364  <code>
19365 
19366  // Change notification halts in Idle mode for Port C
19367  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C);
19368 
19369  </code>
19370  Remarks:
19371  This function is only available in devices with PPS. For Non-PPS devices, use the
19372  PLIB_PORTS_ChangeNoticeInIdleDisable function.
19373 
19374  This feature may not be available on all devices. Please refer to the
19375  specific device data sheet to determine availability or use
19376  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
19377  whether this feature is available.
19378 */
19379 
19380 void
19382  PORTS_MODULE_ID index ,
19383  PORTS_CHANNEL channel ) ;
19384 // *****************************************************************************
19385 /* Function:
19386  bool PLIB_PORTS_ChangeNoticePerPortHasOccurred ( PORTS_MODULE_ID index,
19387  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
19388  Summary:
19389  checks the status of change on the pin
19390  Description:
19391  This function checks if the change has occurred on the given pin or not.
19392  This function does not perform atomic register access.
19393  Precondition:
19394  None.
19395  Parameters:
19396  index - Identifier for the device instance to be configured
19397  channel - Port pin channel
19398  bitPos - Position in the PORT pins
19399  Returns:
19400  None.
19401  Example:
19402  <code>
19403 
19404  if(PLIB_PORTS_ChangeNoticePerPortHasOccurred( PORTS_ID_0,
19405  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
19406  {
19407  //do something
19408  }
19409 
19410  </code>
19411  Remarks:
19412  This feature may not be available on all devices. Please refer to the
19413  specific device data sheet to determine availability or use
19414  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
19415  whether this feature is available.
19416 */
19417 
19418 bool
19420  PORTS_MODULE_ID index ,
19421  PORTS_CHANNEL channel ,
19422  PORTS_BIT_POS bitPos ) ;
19423 // *****************************************************************************
19424 /* Function:
19425  bool PLIB_PORTS_PinGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19426  PORTS_BIT_POS bitPos )
19427  Summary:
19428  Reads/Gets data from the selected digital pin.
19429  Description:
19430  This function reads/gets data from the selected digital PORT i/o pin.
19431  This function should be used to read the live data at the pin.
19432  This function does not perform atomic register access.
19433 
19434  Precondition:
19435  None.
19436  Parameters:
19437  index - Identifier for the device instance to be configured
19438  channel - Identifier for the Ports channel A, B, C, etc.
19439  bitPos - Possible values of PORTS_BIT_POS
19440  Returns:
19441  Port pin read data.
19442  Example:
19443  <code>
19444  // read port pin RC4
19445  bool bitStatus = PLIB_PORTS_PinGet(PORTS_ID_0, PORT_CHANNEL_C,
19446  PORTS_BIT_POS_4);
19447  </code>
19448  Remarks:
19449  For reading the Latched data, PLIB_PORTS_PinGetLatched function should be used.
19450 
19451  This feature may not be available on all devices. Please refer to the
19452  specific device data sheet to determine availability or use
19453  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19454  this feature is available.
19455 */
19456 
19457 bool
19459  PORTS_MODULE_ID index ,
19460  PORTS_CHANNEL channel ,
19461  PORTS_BIT_POS bitPos ) ;
19462 // *****************************************************************************
19463 /* Function:
19464  bool PLIB_PORTS_PinGetLatched( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19465  PORTS_BIT_POS bitPos )
19466  Summary:
19467  Reads/Gets data from the selected latch.
19468  Description:
19469  This function reads/gets data from the selected PORTx Data Latch, not from
19470  the port I/O pins.
19471  This function does not perform atomic register access.
19472 
19473  Precondition:
19474  None.
19475  Parameters:
19476  index - Identifier for the device instance to be configured
19477  channel - Identifier for the Ports channel A, B, C, etc.
19478  bitPos - Possible values of PORTS_BIT_POS
19479  Returns:
19480  Latch read data.
19481  Example:
19482  <code>
19483  // read latch RC4
19484  bool bitStatus = PLIB_PORTS_PinGetLatched(PORTS_ID_0, PORT_CHANNEL_C,
19485  PORTS_BIT_POS_4);
19486  </code>
19487  Remarks:
19488  For reading the Live data from the i/o pin, PLIB_PORTS_PinGet function
19489  should be used.
19490 
19491  This feature may not be available on all devices. Please refer to the
19492  specific device data sheet to determine availability or use
19493  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19494  this feature is available.
19495 */
19496 
19497 bool
19499  PORTS_MODULE_ID index ,
19500  PORTS_CHANNEL channel ,
19501  PORTS_BIT_POS bitPos ) ;
19502 // *****************************************************************************
19503 /* Function:
19504  void PLIB_PORTS_PinWrite( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19505  PORTS_BIT_POS bitPos,
19506  bool value )
19507  Summary:
19508  Writes the selected digital pin/latch.
19509  Description:
19510  This function writes to the selected digital pin/latch.
19511  This function does not perform atomic register access.
19512  Precondition:
19513  None.
19514  Parameters:
19515  index - Identifier for the device instance to be configured
19516  channel - Identifier for the Ports channel A, B, C, etc.
19517  bitPos - Possible values of PORTS_BIT_POS
19518  value - Value to be written to the specific pin/latch
19519  true - sets the bit, false - clears the bit
19520  Returns:
19521  None.
19522  Example:
19523  <code>
19524 
19525  // write 'one' in port RC4
19526  PLIB_PORTS_PinWrite(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4, 1);
19527 
19528  </code>
19529  Remarks:
19530  This feature may not be available on all devices. Please refer to the
19531  specific device data sheet to determine availability or use
19532  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19533  this feature is available.
19534 */
19535 
19536 void
19538  PORTS_MODULE_ID index ,
19539  PORTS_CHANNEL channel ,
19540  PORTS_BIT_POS bitPos ,
19541  bool value ) ;
19542 // *****************************************************************************
19543 /* Function:
19544  void PLIB_PORTS_PinSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19545  PORTS_BIT_POS bitPos )
19546  Summary:
19547  Sets the selected digital pin/latch.
19548  Description:
19549  This function sets the selected digital pin/latch.
19550  This function does not perform atomic register access.
19551  Precondition:
19552  None.
19553  Parameters:
19554  index - Identifier for the device instance to be configured
19555  channel - Identifier for the Ports channel A, B, C, etc.
19556  bitPos - Possible values of PORTS_BIT_POS
19557  Returns:
19558  None.
19559  Example:
19560  <code>
19561 
19562  // Sets port pin RC4
19563  PLIB_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19564 
19565  </code>
19566  Remarks:
19567  This feature may not be available on all devices. Please refer to the
19568  specific device data sheet to determine availability or use
19569  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19570  this feature is available.
19571 */
19572 
19573 void
19575  PORTS_MODULE_ID index ,
19576  PORTS_CHANNEL channel ,
19577  PORTS_BIT_POS bitPos ) ;
19578 // *****************************************************************************
19579 /* Function:
19580  void PLIB_PORTS_PinClear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19581  PORTS_BIT_POS bitPos )
19582  Summary:
19583  Clears the selected digital pin/latch.
19584  Description:
19585  This function clears the selected digital pin/latch.
19586  This function does not perform atomic register access.
19587  Precondition:
19588  None.
19589  Parameters:
19590  index - Identifier for the device instance to be configured
19591  channel - Identifier for the Ports channel A, B, C, etc.
19592  bitPos - Possible values of PORTS_BIT_POS
19593  Returns:
19594  None.
19595  Example:
19596  <code>
19597 
19598  // Clears port pin RC4
19599  PLIB_PORTS_PinClear(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19600 
19601  </code>
19602  Remarks:
19603  This feature may not be available on all devices. Please refer to the
19604  specific device data sheet to determine availability or use
19605  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19606  this feature is available.
19607 */
19608 
19609 void
19611  PORTS_MODULE_ID index ,
19612  PORTS_CHANNEL channel ,
19613  PORTS_BIT_POS bitPos ) ;
19614 // *****************************************************************************
19615 /* Function:
19616  void PLIB_PORTS_PinToggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19617  PORTS_BIT_POS bitPos )
19618  Summary:
19619  Toggles the selected digital pin/latch.
19620  Description:
19621  This function toggles the selected digital pin/latch.
19622  This function does not perform atomic register access.
19623  Precondition:
19624  None.
19625  Parameters:
19626  index - Identifier for the device instance to be configured
19627  channel - Identifier for the Ports channel A, B, C, etc.
19628  bitPos - Possible values of PORTS_BIT_POS
19629  Returns:
19630  None.
19631  Example:
19632  <code>
19633 
19634  // Toggles port pin RC4
19635  PLIB_PORTS_PinToggle(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19636 
19637  </code>
19638  Remarks:
19639  This feature may not be available on all devices. Please refer to the
19640  specific device data sheet to determine availability or use
19641  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19642  this feature is available.
19643 */
19644 
19645 void
19647  PORTS_MODULE_ID index ,
19648  PORTS_CHANNEL channel ,
19649  PORTS_BIT_POS bitPos ) ;
19650 // *****************************************************************************
19651 /* Function:
19652  void PLIB_PORTS_PinDirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19653  PORTS_BIT_POS bitPos )
19654  Summary:
19655  Makes the selected pin direction input
19656  Description:
19657  This function makes the selected pin direction as input
19658  This function does not perform atomic register access.
19659  Precondition:
19660  None.
19661  Parameters:
19662  index - Identifier for the device instance to be configured
19663  channel - Identifier for the Ports channel A, B, C, etc.
19664  bitPos - Possible values of PORTS_BIT_POS direction that has to
19665  be made input
19666  Returns:
19667  None.
19668  Example:
19669  <code>
19670 
19671  // make pin RC4 as input
19672  PLIB_PORTS_PinDirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19673 
19674  </code>
19675  Remarks:
19676  This feature may not be available on all devices. Please refer to the
19677  specific device data sheet to determine availability or use
19678  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19679  this feature is available.
19680 */
19681 
19682 void
19684  PORTS_MODULE_ID index ,
19685  PORTS_CHANNEL channel ,
19686  PORTS_BIT_POS bitPos ) ;
19687 // *****************************************************************************
19688 /* Function:
19689  void PLIB_PORTS_PinDirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19690  PORTS_BIT_POS bitPos )
19691  Summary:
19692  Makes the selected pin direction output
19693  Description:
19694  This function makes the selected pin direction as output
19695  This function does not perform atomic register access.
19696  Precondition:
19697  None.
19698  Parameters:
19699  index - Identifier for the device instance to be configured
19700  channel - Identifier for the Ports channel A, B, C, etc.
19701  bitPos - Possible values of PORTS_BIT_POS direction that has to
19702  be made output
19703  Returns:
19704  None.
19705  Example:
19706  <code>
19707 
19708  // make pin RC4 as output
19709  PLIB_PORTS_PinDirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19710 
19711  </code>
19712  Remarks:
19713  This feature may not be available on all devices. Please refer to the
19714  specific device data sheet to determine availability or use
19715  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19716  this feature is available.
19717 */
19718 
19719 void
19721  PORTS_MODULE_ID index ,
19722  PORTS_CHANNEL channel ,
19723  PORTS_BIT_POS bitPos ) ;
19724 // *****************************************************************************
19725 /* Function:
19726  void PLIB_PORTS_PinOpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19727  PORTS_BIT_POS bitPos )
19728  Summary:
19729  Enables the open drain functionality for the selected pin.
19730  Description:
19731  This function enables the open drain functionality for the selected pin.
19732  This function does not perform atomic register access.
19733  Precondition:
19734  None.
19735  Parameters:
19736  index - Identifier for the device instance to be configured
19737  channel - Identifier for the Ports channel A, B, C, etc.
19738  bitPos - Possible values of PORTS_BIT_POS
19739  Returns:
19740  None.
19741  Example:
19742  <code>
19743 
19744  // Enable open drain for pin RC4
19745  PLIB_PORTS_PinOpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19746 
19747  </code>
19748  Remarks:
19749  This feature may not be available on all devices. Please refer to the
19750  specific device data sheet to determine availability or use
19751  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19752  this feature is available.
19753 */
19754 
19755 void
19757  PORTS_MODULE_ID index ,
19758  PORTS_CHANNEL channel ,
19759  PORTS_BIT_POS bitPos ) ;
19760 // *****************************************************************************
19761 /* Function:
19762  void PLIB_PORTS_PinOpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19763  PORTS_BIT_POS bitPos )
19764  Summary:
19765  Disables the open drain functionality for the selected pin.
19766  Description:
19767  This function disables the open drain functionality for the selected pin.
19768  This function does not perform atomic register access.
19769  Precondition:
19770  None.
19771  Parameters:
19772  index - Identifier for the device instance to be configured
19773  channel - Identifier for the Ports channel A, B, C, etc.
19774  bitPos - One of the possible values of PORTS_BIT_POS.
19775  Returns:
19776  None.
19777  Example:
19778  <code>
19779 
19780  // Disable open drain for pin RC4
19781  PLIB_PORTS_PinOpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19782 
19783  </code>
19784  Remarks:
19785  This feature may not be available on all devices. Please refer to the
19786  specific device data sheet to determine availability or use
19787  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19788  this feature is available.
19789 */
19790 
19791 void
19793  PORTS_MODULE_ID index ,
19794  PORTS_CHANNEL channel ,
19795  PORTS_BIT_POS bitPos ) ;
19796 // *****************************************************************************
19797 /* Function:
19798  PORTS_DATA_TYPE PLIB_PORTS_ReadLatched
19799  (
19800  PORTS_MODULE_ID index,
19801  PORTS_CHANNEL channel
19802  )
19803  Summary:
19804  Reads and returns data from the selected Latch.
19805  Description:
19806  This function reads and returns the data from the selected Latch.
19807  This function does not perform atomic register access.
19808 
19809  Precondition:
19810  None.
19811  Parameters:
19812  index - Identifier for the device instance to be configured
19813  channel - Identifier for the Ports channel A, B, C, etc.
19814  Returns:
19815  Latch read data.
19816  Example:
19817  <code>
19818  // Read latch C
19819  PORTS_DATA_TYPE bitStatus = PLIB_PORTS_ReadLatched(PORTS_ID_0, PORT_CHANNEL_C);
19820 
19821  </code>
19822  Remarks:
19823  For reading the Live data, PLIB_PORTS_Read function should be used.
19824 
19825  This feature may not be available on all devices. Please refer to the
19826  specific device data sheet to determine availability or use
19827  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19828  this feature is available.
19829 */
19830 
19833  PORTS_MODULE_ID index ,
19834  PORTS_CHANNEL channel ) ;
19835 // *****************************************************************************
19836 /* Function:
19837  PORTS_DATA_TYPE PLIB_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19838  Summary:
19839  Reads the selected digital port.
19840  Description:
19841  This function reads from the selected digital port.
19842  This function does not perform atomic register access.
19843  Precondition:
19844  None.
19845  Parameters:
19846  index - Identifier for the device instance to be configured
19847  channel - Identifier for the Ports channel A, B, C, etc.
19848  Returns:
19849  data on a port with width PORTS_DATA_TYPE
19850  Example:
19851  <code>
19852 
19853  // Read PORT C
19854  PORTS_DATA_TYPE readData = PLIB_PORTS_Read(PORTS_ID_0, PORT_CHANNEL_C);
19855 
19856  </code>
19857  Remarks:
19858  For reading the Latched data, PLIB_PORTS_ReadLatched function should be used.
19859 
19860  This feature may not be available on all devices. Please refer to the
19861  specific device data sheet to determine availability or use
19862  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19863  this feature is available.
19864 */
19865 
19867  PLIB_PORTS_Read (
19868  PORTS_MODULE_ID index ,
19869  PORTS_CHANNEL channel ) ;
19870 // *****************************************************************************
19871 /* Function:
19872  void PLIB_PORTS_Write( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19873  PORTS_DATA_TYPE value )
19874  Summary:
19875  Writes the selected digital port/latch.
19876  Description:
19877  This function writes to the selected digital port/latch.
19878  This function does not perform atomic register access.
19879  Precondition:
19880  None.
19881  Parameters:
19882  index - Identifier for the device instance to be configured
19883  channel - Identifier for the Ports channel A, B, C, etc.
19884  value - Value to be written into a port of width PORTS_DATA_TYPE
19885  Returns:
19886  None.
19887  Example:
19888  <code>
19889 
19890  // Write 0x12 into PORT C
19891  PLIB_PORTS_Write(PORTS_ID_0, PORT_CHANNEL_C, 0x12);
19892 
19893  </code>
19894  Remarks:
19895  This feature may not be available on all devices. Please refer to the
19896  specific device data sheet to determine availability or use
19897  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19898  this feature is available.
19899 */
19900 
19901 void
19903  PORTS_MODULE_ID index ,
19904  PORTS_CHANNEL channel ,
19905  PORTS_DATA_TYPE value ) ;
19906 // *****************************************************************************
19907 /* Function:
19908  void PLIB_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19909  PORTS_DATA_TYPE value,
19910  PORTS_DATA_MASK mask )
19911  Summary:
19912  Sets the selected bits of the port.
19913  Description:
19914  This function performs an 'AND' operation on the value and mask parameters,
19915  and then sets the bits in the port channel that were set by the result of the
19916  'AND' operation.
19917  This function does not perform atomic register access.
19918  Precondition:
19919  None.
19920  Parameters:
19921  index - Identifier for the device instance to be configured
19922  channel - Identifier for the Ports channel A, B, C, etc.
19923  value - Consists of information about which port bit has to be
19924  set and which not
19925  mask - Identifies the bits which could be intended for setting
19926  Returns:
19927  None.
19928  Example:
19929  <code>
19930 
19931  // MY_VALUE - 0x1234
19932  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
19933 
19934  // Set the PORT C bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
19935  PLIB_PORTS_Set(MY_PORTS_INSTANCE, PORT_CHANNEL_C, MY_VALUE, myMask);
19936 
19937  </code>
19938  Remarks:
19939  This feature may not be available on all devices. Please refer to the
19940  specific device data sheet to determine availability or use
19941  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19942  this feature is available.
19943 */
19944 
19945 void
19946  PLIB_PORTS_Set (
19947  PORTS_MODULE_ID index ,
19948  PORTS_CHANNEL channel ,
19949  PORTS_DATA_TYPE value ,
19950  PORTS_DATA_MASK mask ) ;
19951 // *****************************************************************************
19952 /* Function:
19953  void PLIB_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19954  PORTS_DATA_MASK toggleMask )
19955  Summary:
19956  Toggles the selected digital port/latch.
19957  Description:
19958  This function toggles the selected digital port/latch.
19959  This function does not perform atomic register access.
19960  Precondition:
19961  None.
19962  Parameters:
19963  index - Identifier for the device instance to be configured
19964  channel - Identifier for the Ports channel A, B, C, etc.
19965  toggleMask - Identifies the bits to be toggled
19966  Returns:
19967  None.
19968  Example:
19969  <code>
19970 
19971  // Toggles the three least significant Port C bits
19972  PLIB_PORTS_Toggle(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19973 
19974  </code>
19975  Remarks:
19976  This feature may not be available on all devices. Please refer to the
19977  specific device data sheet to determine availability or use
19978  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19979  this feature is available.
19980 */
19981 
19982 void
19984  PORTS_MODULE_ID index ,
19985  PORTS_CHANNEL channel ,
19986  PORTS_DATA_MASK toggleMask ) ;
19987 // *****************************************************************************
19988 /* Function:
19989  void PLIB_PORTS_Clear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19990  PORTS_DATA_MASK clearMask )
19991  Summary:
19992  Clears the selected digital port/latch bits.
19993  Description:
19994  This function clears the selected digital port/latch bits.
19995  This function does not perform atomic register access.
19996  Precondition:
19997  None.
19998  Parameters:
19999  index - Identifier for the device instance to be configured
20000  channel - Identifier for the Ports channel A, B, C, etc.
20001  clearMask - Identifies the bits to be cleared
20002  Returns:
20003  None.
20004  Example:
20005  <code>
20006 
20007  // Clears the three least significant Port C bits
20008  PLIB_PORTS_Clear(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
20009 
20010  </code>
20011  Remarks:
20012  This feature may not be available on all devices. Please refer to the
20013  specific device data sheet to determine availability or use
20014  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
20015  this feature is available.
20016 */
20017 
20018 void
20020  PORTS_MODULE_ID index ,
20021  PORTS_CHANNEL channel ,
20022  PORTS_DATA_MASK clearMask ) ;
20023 // *****************************************************************************
20024 /* Function:
20025  void PLIB_PORTS_DirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
20026  PORTS_DATA_MASK mask )
20027  Summary:
20028  Makes the selected pins direction input.
20029  Description:
20030  This function makes the selected pins direction input.
20031  This function does not perform atomic register access.
20032 
20033  Precondition:
20034  None.
20035  Parameters:
20036  index - Identifier for the device instance to be configured
20037  channel - Identifier for the Ports channel A, B, C, etc.
20038  mask - Identifies the pins direction that has to be made input
20039  Returns:
20040  None.
20041  Example:
20042  <code>
20043 
20044  // Make RC0, RC1 and RC2 pins as Input
20045  PLIB_PORTS_DirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
20046 
20047  </code>
20048  Remarks:
20049  This feature may not be available on all devices. Please refer to the
20050  specific device data sheet to determine availability or use
20051  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
20052  this feature is available.
20053 */
20054 
20055 void
20057  PORTS_MODULE_ID index ,
20058  PORTS_CHANNEL channel ,
20059  PORTS_DATA_MASK mask ) ;
20060 // *****************************************************************************
20061 /* Function:
20062  void PLIB_PORTS_DirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
20063  PORTS_DATA_MASK mask )
20064  Summary:
20065  Makes the selected pins direction output.
20066  Description:
20067  This function makes the selected pins direction output.
20068  This function does not perform atomic register access.
20069  Precondition:
20070  None.
20071  Parameters:
20072  index - Identifier for the device instance to be configured
20073  channel - Identifier for the Ports channel A, B, C, etc.
20074  mask - Identifies the pins direction that has to be made output
20075  Returns:
20076  None.
20077  Example:
20078  <code>
20079 
20080  // Make RC0, RC1 and RC2 pins as Output
20081  PLIB_PORTS_DirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
20082 
20083  </code>
20084  Remarks:
20085  This feature may not be available on all devices. Please refer to the
20086  specific device data sheet to determine availability or use
20087  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
20088  this feature is available.
20089 */
20090 
20091 void
20093  PORTS_MODULE_ID index ,
20094  PORTS_CHANNEL channel ,
20095  PORTS_DATA_MASK mask ) ;
20096 // *****************************************************************************
20097 /* Function:
20098  PORTS_DATA_MASK PLIB_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
20099  Summary:
20100  Reads the direction of the selected digital port.
20101  Description:
20102  This function reads the direction of the selected digital port.
20103  This function does not perform atomic register access.
20104  Precondition:
20105  None.
20106  Parameters:
20107  index - Identifier for the device instance to be configured
20108  channel - Identifier for the Ports channel A, B, C, etc.
20109  Returns:
20110  Direction of the selected port of type PORTS_DATA_MASK
20111  Example:
20112  <code>
20113 
20114  // Reads the direction of Port C pins
20115  PORTS_DATA_MASK readDir = PLIB_PORTS_DirectionGet(PORTS_ID_0, PORT_CHANNEL_C);
20116 
20117  </code>
20118  Remarks:
20119  This feature may not be available on all devices. Please refer to the
20120  specific device data sheet to determine availability or use
20121  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
20122  this feature is available.
20123 */
20124 
20127  PORTS_MODULE_ID index ,
20128  PORTS_CHANNEL channel ) ;
20129 // *****************************************************************************
20130 /* Function:
20131  void PLIB_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
20132  PORTS_DATA_MASK mask )
20133  Summary:
20134  Enables the open drain functionality for the selected port pins.
20135  Description:
20136  This function enables the open drain functionality for the selected port pins.
20137  This function does not perform atomic register access.
20138  Precondition:
20139  None.
20140  Parameters:
20141  index - Identifier for the device instance to be configured
20142  channel - Identifier for the Ports channel A, B, C, etc.
20143  mask - Identifies the pins for the open drain to be enabled
20144  Returns:
20145  None.
20146  Example:
20147  <code>
20148 
20149  // Enable Open Drain for RC0, RC1 and RC2 pins
20150  PLIB_PORTS_OpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
20151 
20152  </code>
20153  Remarks:
20154  This feature may not be available on all devices. Please refer to the
20155  specific device data sheet to determine availability or use
20156  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
20157  this feature is available.
20158 */
20159 
20160 void
20162  PORTS_MODULE_ID index ,
20163  PORTS_CHANNEL channel ,
20164  PORTS_DATA_MASK mask ) ;
20165 // *****************************************************************************
20166 /* Function:
20167  void PLIB_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
20168  PORTS_DATA_MASK mask )
20169  Summary:
20170  Disables the open drain functionality for the selected port.
20171  Description:
20172  This function disables the open drain functionality for the selected port.
20173  This function does not perform atomic register access.
20174 
20175  Precondition:
20176  None.
20177  Parameters:
20178  index - Identifier for the device instance to be configured
20179  channel - Identifier for the Ports channel A, B, C, etc.
20180  mask - Identifies the pins for the open drain to be disabled
20181  Returns:
20182  None.
20183  Example:
20184  <code>
20185 
20186  // Disable Open Drain for RC0, RC1 and RC2 pins
20187  PLIB_PORTS_OpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
20188 
20189  </code>
20190  Remarks:
20191  This feature may not be available on all devices. Please refer to the
20192  specific device data sheet to determine availability or use
20193  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
20194  this feature is available.
20195 */
20196 
20197 void
20199  PORTS_MODULE_ID index ,
20200  PORTS_CHANNEL channel ,
20201  PORTS_DATA_MASK mask ) ;
20202 // *****************************************************************************
20203 /* Function:
20204  void PLIB_PORTS_ChannelModeSelect
20205  (
20206  PORTS_MODULE_ID index,
20207  PORTS_CHANNEL channel,
20208  PORTS_DATA_MASK modeMask,
20209  PORTS_PIN_MODE mode
20210  );
20211  Summary:
20212  Enables the selected channel pins as analog or digital.
20213  Description:
20214  This function enables the selected channel pins as analog or digital.
20215  This function does not perform atomic register access.
20216  Precondition:
20217  None.
20218  Parameters:
20219  index - Identifier for the device instance to be configured
20220  channel - Port pin channel
20221  modeMask - Identifies the pins whose mode has to be modified.
20222  Modes of the pins whose corresponding bit is '1' get
20223  modified, mode of the other pins remains the same.
20224  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
20225  Returns:
20226  None.
20227  Example:
20228  <code>
20229 
20230  // Make pins RC5, RC8 and RC13 Analog
20231  PLIB_PORTS_ChannelModeSelect(PORTS_ID_0, PORT_CHANNEL_C, 0x2120, PORTS_PIN_MODE_ANALOG);
20232 
20233  </code>
20234  Remarks:
20235  This function is only available in devices with PPS. For Non-PPS devices, use the
20236  PLIB_PORTS_AnPinsModeSelect function.
20237 
20238  This feature may not be available on all devices. Please refer to the
20239  specific device data sheet to determine availability or use
20240  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
20241  this feature is available.
20242 */
20243 
20244 void
20246  PORTS_MODULE_ID index ,
20247  PORTS_CHANNEL channel ,
20248  PORTS_DATA_MASK modeMask ,
20249  PORTS_PIN_MODE mode ) ;
20250 // *****************************************************************************
20251 /* Function:
20252  void PLIB_PORTS_ChannelChangeNoticePullUpEnable
20253  (
20254  PORTS_MODULE_ID index,
20255  PORTS_CHANNEL channel,
20256  PORTS_DATA_MASK mask
20257  );
20258  Summary:
20259  Enables Change Notice pull-up for the selected channel pins.
20260  Description:
20261  This function enables the Change Notice pull-up for the selected
20262  channel pins.
20263  This function does not perform atomic register access.
20264  Precondition:
20265  None.
20266  Parameters:
20267  index - Identifier for the device instance to be configured
20268  channel - Port pin channel
20269  mask - Identifies the pins of the pull-up to be enabled
20270  Returns:
20271  None.
20272  Example:
20273  <code>
20274 
20275  // Enable pull-up for RC5, RC8 and RC13 pins
20276  PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_ID_0, PORT_CHANNEL_C,
20277  0x2120);
20278  </code>
20279  Remarks:
20280  This function is only available in devices with PPS. For Non-PPS devices, use the
20281  PLIB_PORTS_CnPinsPullUpEnable function.
20282 
20283  This feature may not be available on all devices. Please refer to the
20284  specific device data sheet to determine availability or use
20285  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
20286  determine whether this feature is available.
20287 */
20288 
20289 void
20291  PORTS_MODULE_ID index ,
20292  PORTS_CHANNEL channel ,
20293  PORTS_DATA_MASK mask ) ;
20294 // *****************************************************************************
20295 /* Function:
20296  void PLIB_PORTS_ChannelChangeNoticePullUpDisable
20297  (
20298  PORTS_MODULE_ID index,
20299  PORTS_CHANNEL channel,
20300  PORTS_DATA_MASK mask
20301  );
20302  Summary:
20303  Disables Change Notice pull-up for the selected channel pins.
20304  Description:
20305  This function Disables the Change Notice pull-up for the selected
20306  channel pins.
20307  PLIB_PORTS_ChannelChangeNoticePullUpDisable
20308  Precondition:
20309  None.
20310  Parameters:
20311  index - Identifier for the device instance to be configured
20312  channel - Port pin channel
20313  mask - Identifies the pins of the pull-up to be disabled
20314  Returns:
20315  None.
20316  Example:
20317  <code>
20318 
20319  // Disable pull-up for RC5, RC8 and RC13 pins
20320  PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_ID_0, PORT_CHANNEL_C,
20321  0x2120);
20322  </code>
20323  Remarks:
20324  This function is only available in devices with PPS. For Non-PPS devices, use the
20325  PLIB_PORTS_CnPinsPullUpDisable function.
20326 
20327  This feature may not be available on all devices. Please refer to the
20328  specific device data sheet to determine availability or use
20329  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
20330  determine whether this feature is available.
20331 */
20332 
20333 void
20335  PORTS_MODULE_ID index ,
20336  PORTS_CHANNEL channel ,
20337  PORTS_DATA_MASK mask ) ;
20338 // *****************************************************************************
20339 /* Function:
20340  void PLIB_PORTS_ChannelChangeNoticePullDownEnable
20341  (
20342  PORTS_MODULE_ID index,
20343  PORTS_CHANNEL channel,
20344  PORTS_DATA_MASK mask
20345  );
20346  Summary:
20347  Enables Change Notice pull-down for the selected channel pins.
20348  Description:
20349  This function enables the Change Notice pull-down for the selected
20350  channel pins.
20351  This function does not perform atomic register access.
20352  Precondition:
20353  None.
20354  Parameters:
20355  index - Identifier for the device instance to be configured
20356  channel - Port pin channel
20357  mask - Identifies the pins for the pull-down to be enabled
20358  Returns:
20359  None.
20360  Example:
20361  <code>
20362 
20363  // Enable pull-down for RC5, RC8 and RC13 pins
20364  PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_ID_0, PORT_CHANNEL_C,
20365  0x2120);
20366  </code>
20367  Remarks:
20368  This feature may not be available on all devices. Please refer to the
20369  specific device data sheet to determine availability or use
20370  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20371  determine whether this feature is available.
20372 */
20373 
20374 void
20376  PORTS_MODULE_ID index ,
20377  PORTS_CHANNEL channel ,
20378  PORTS_DATA_MASK mask ) ;
20379 // *****************************************************************************
20380 /* Function:
20381  void PLIB_PORTS_ChannelChangeNoticePullDownDisable
20382  (
20383  PORTS_MODULE_ID index,
20384  PORTS_CHANNEL channel,
20385  PORTS_DATA_MASK mask
20386  );
20387  Summary:
20388  Disables Change Notice pull-down for the selected channel pins.
20389  Description:
20390  This function Disables the Change Notice pull-down for the selected
20391  channel pins.
20392  This function does not perform atomic register access.
20393  Precondition:
20394  None.
20395  Parameters:
20396  index - Identifier for the device instance to be configured
20397  channel - Port pin channel
20398  mask - Identifies the pins for the pull-down to be disabled
20399  Returns:
20400  None.
20401  Example:
20402  <code>
20403 
20404  // Disable pull-down for RC5, RC8 and RC13 pins
20405  PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_ID_0, PORT_CHANNEL_C,
20406  0x2120);
20407  </code>
20408  Remarks:
20409  This feature may not be available on all devices. Please refer to the
20410  specific device data sheet to determine availability or use
20411  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20412  determine whether this feature is available.
20413 */
20414 
20415 void
20417  PORTS_MODULE_ID index ,
20418  PORTS_CHANNEL channel ,
20419  PORTS_DATA_MASK mask ) ;
20420 // *****************************************************************************
20421 /* Function:
20422  void PLIB_PORTS_ChannelChangeNoticeEnable
20423  (
20424  PORTS_MODULE_ID index,
20425  PORTS_CHANNEL channel,
20426  PORTS_DATA_MASK mask
20427  );
20428  Summary:
20429  Enables CN interrupt for the selected pins of a channel.
20430  Description:
20431  This function enables Change Notice interrupt for the selected port
20432  pins of a channel.
20433  This function does not perform atomic register access.
20434  Precondition:
20435  None.
20436  Parameters:
20437  index - Identifier for the device instance to be configured
20438  channel - Port pin channel
20439  mask - Identifies the pins for which change notification is
20440  to be enabled
20441  Returns:
20442  None.
20443  Example:
20444  <code>
20445 
20446  // Enable CN interrupt for RC5, RC8 and RC13 pins
20447  PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20448 
20449  </code>
20450  Remarks:
20451  This function is only available in devices with PPS. For Non-PPS devices, use the
20452  PLIB_PORTS_CnPinsEnable function.
20453 
20454  This feature may not be available on all devices. Please refer to the
20455  specific device data sheet to determine availability or use
20456  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20457  determine whether this feature is available.
20458 */
20459 
20460 void
20462  PORTS_MODULE_ID index ,
20463  PORTS_CHANNEL channel ,
20464  PORTS_DATA_MASK mask ) ;
20465 // *****************************************************************************
20466 /* Function:
20467  void PLIB_PORTS_ChannelChangeNoticeDisable
20468  (
20469  PORTS_MODULE_ID index,
20470  PORTS_CHANNEL channel,
20471  PORTS_DATA_MASK mask
20472  );
20473  Summary:
20474  Disables CN interrupt for the selected pins of a channel.
20475  Description:
20476  This function Disables Change Notice interrupt for the selected port
20477  pins of a channel.
20478  This function does not perform atomic register access.
20479  Precondition:
20480  None.
20481  Parameters:
20482  index - Identifier for the device instance to be configured
20483  channel - Port pin channel
20484  mask - Identifies the pins for which change notification is
20485  to be disabled
20486  Returns:
20487  None.
20488  Example:
20489  <code>
20490 
20491  // Disable CN interrupt for RC5, RC8 and RC13 pins
20492  PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20493 
20494  </code>
20495  Remarks:
20496  This function is only available in devices with PPS. For Non-PPS devices, use the
20497  PLIB_PORTS_CnPinsDisable function.
20498 
20499  This feature may not be available on all devices. Please refer to the
20500  specific device data sheet to determine availability or use
20501  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20502  determine whether this feature is available.
20503 */
20504 
20505 void
20507  PORTS_MODULE_ID index ,
20508  PORTS_CHANNEL channel ,
20509  PORTS_DATA_MASK mask ) ;
20510 // *****************************************************************************
20511 /* Function:
20512  void PLIB_PORTS_AnPinsModeSelect
20513  (
20514  PORTS_MODULE_ID index,
20515  PORTS_AN_PIN anPins,
20516  PORTS_PIN_MODE mode
20517  );
20518  Summary:
20519  Enables the selected AN pins as analog or digital.
20520  Description:
20521  This function enables the selected AN pins as analog or digital.
20522  This function does not perform atomic register access.
20523  Precondition:
20524  None.
20525  Parameters:
20526  index - Identifier for the device instance to be configured
20527  anPins - AN pins whose mode is to be changed. Multiple AN pins
20528  can be ORed.
20529  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
20530  Returns:
20531  None.
20532  Example:
20533  <code>
20534 
20535  // Make pins AN5, AN8 and AN13 Analog
20536  PLIB_PORTS_AnPinsModeSelect(PORTS_ID_0, PORTS_AN_PIN_5 |
20537  PORTS_AN_PIN_8 |
20538  PORTS_AN_PIN_13,
20539  PORTS_PIN_MODE_ANALOG);
20540 
20541  </code>
20542  Remarks:
20543  This function is only available in devices without PPS feature. For PPS
20544  devices, use the PLIB_PORTS_ChannelModeSelect function.
20545 
20546  This feature may not be available on all devices. Please refer to the
20547  specific device data sheet to determine availability or use
20548  PLIB_PORTS_ExistsAnPinsMode in your application to determine whether
20549  this feature is available.
20550 */
20551 
20552 void
20554  PORTS_MODULE_ID index ,
20555  PORTS_AN_PIN anPins ,
20556  PORTS_PIN_MODE mode ) ;
20557 // *****************************************************************************
20558 /* Function:
20559  void PLIB_PORTS_CnPinsPullUpEnable
20560  (
20561  PORTS_MODULE_ID index,
20562  PORTS_CN_PIN cnPins
20563  );
20564  Summary:
20565  Enables Change Notice pull-up for the selected channel pins.
20566  Description:
20567  This function enables the Change Notice pull-up for the selected
20568  channel pins.
20569  This function performs atomic register access.
20570  Precondition:
20571  None.
20572  Parameters:
20573  index - Identifier for the device instance to be configured
20574  cnPins - CN pins whose pull-up is to be enabled. Multiple CN pins
20575  can be ORed.
20576  Returns:
20577  None.
20578  Example:
20579  <code>
20580 
20581  // Enable pull-up for CN5, CN8 and CN13 pins
20582  PLIB_PORTS_CnPinsPullUpEnable(PORTS_ID_0, CHANGE_NOTICE_PIN_5 |
20583  CHANGE_NOTICE_PIN_8 |
20584  CHANGE_NOTICE_PIN_13);
20585 
20586  </code>
20587  Remarks:
20588  This function is only available in devices without PPS feature. For PPS
20589  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpEnable function.
20590 
20591  This feature may not be available on all devices. Please refer to the
20592  specific device data sheet to determine availability or use
20593  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20594  determine whether this feature is available.
20595 */
20596 
20597 void
20599  PORTS_MODULE_ID index ,
20600  PORTS_CN_PIN cnPins ) ;
20601 // *****************************************************************************
20602 /* Function:
20603  void PLIB_PORTS_CnPinsPullUpDisable
20604  (
20605  PORTS_MODULE_ID index,
20606  PORTS_CN_PIN cnPins
20607  );
20608  Summary:
20609  Disables Change Notice pull-up for the selected channel pins.
20610  Description:
20611  This function Disables the Change Notice pull-up for the selected
20612  channel pins.
20613  This function performs atomic register access.
20614  Precondition:
20615  None.
20616  Parameters:
20617  index - Identifier for the device instance to be configured
20618  cnPins - CN pins whose pull-up is to be disabled. Multiple CN pins
20619  can be ORed.
20620  Returns:
20621  None.
20622  Example:
20623  <code>
20624 
20625  // Disable pull-up for CN5, CN8 and CN13 pins
20626  PLIB_PORTS_CnPinsPullUpDisable(PORTS_ID_0,
20627  CHANGE_NOTICE_PIN_5 |
20628  CHANGE_NOTICE_PIN_8 |
20629  CHANGE_NOTICE_PIN_13);
20630 
20631  </code>
20632  Remarks:
20633  This function is only available in devices without PPS feature. For PPS
20634  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpDisable function.
20635 
20636  This feature may not be available on all devices. Please refer to the
20637  specific device data sheet to determine availability or use
20638  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20639  determine whether this feature is available.
20640 */
20641 
20642 void
20644  PORTS_MODULE_ID index ,
20645  PORTS_CN_PIN cnPins ) ;
20646 // *****************************************************************************
20647 /* Function:
20648  void PLIB_PORTS_CnPinsEnable
20649  (
20650  PORTS_MODULE_ID index,
20651  PORTS_CN_PIN cnPins
20652  );
20653  Summary:
20654  Enables CN interrupt for the selected pins of a channel.
20655  Description:
20656  This function enables Change Notice interrupt for the selected port
20657  pins of a channel.
20658  This function performs atomic register access.
20659  Precondition:
20660  None.
20661  Parameters:
20662  index - Identifier for the device instance to be configured
20663  cnPins - CN pins to be enabled. Multiple CN pins can be ORed.
20664  Returns:
20665  None.
20666  Example:
20667  <code>
20668 
20669  // Enable CN interrupt for CN5, CN8 and CN13 pins
20670  PLIB_PORTS_CnPinsEnable(PORTS_ID_0,
20671  CHANGE_NOTICE_PIN_5 |
20672  CHANGE_NOTICE_PIN_8 |
20673  CHANGE_NOTICE_PIN_13);
20674 
20675  </code>
20676  Remarks:
20677  This function is only available in devices without PPS feature. For PPS
20678  devices, use the PLIB_PORTS_ChannelChangeNoticeEnable function.
20679 
20680  This feature may not be available on all devices. Please refer to the
20681  specific device data sheet to determine availability or use
20682  PLIB_PORTS_ExistsPinChangeNotice in your application to
20683  determine whether this feature is available.
20684 */
20685 
20686 void
20688  PORTS_MODULE_ID index ,
20689  PORTS_CN_PIN cnPins ) ;
20690 // *****************************************************************************
20691 /* Function:
20692  void PLIB_PORTS_CnPinsDisable
20693  (
20694  PORTS_MODULE_ID index,
20695  PORTS_CN_PIN cnPins
20696  );
20697  Summary:
20698  Disables CN interrupt for the selected pins of a channel.
20699  Description:
20700  This function Disables Change Notice interrupt for the selected port
20701  pins of a channel.
20702  This function performs atomic register access.
20703  Precondition:
20704  None.
20705  Parameters:
20706  index - Identifier for the device instance to be configured
20707  cnPins - CN pins to be disabled. Multiple CN pins can be ORed.
20708  Returns:
20709  None.
20710  Example:
20711  <code>
20712 
20713  // Disable CN interrupt for CN5, CN8 and CN13 pins
20714  PLIB_PORTS_CnPinsDisable(PORTS_ID_0,
20715  CHANGE_NOTICE_PIN_5 |
20716  CHANGE_NOTICE_PIN_8 |
20717  CHANGE_NOTICE_PIN_13);
20718 
20719  </code>
20720  Remarks:
20721  This function is only available in devices without PPS feature. For PPS
20722  devices, use the PLIB_PORTS_ChannelChangeNoticeDisable function.
20723 
20724  This feature may not be available on all devices. Please refer to the
20725  specific device data sheet to determine availability or use
20726  PLIB_PORTS_ExistsPinChangeNotice in your application to
20727  determine whether this feature is available.
20728 */
20729 
20730 void
20732  PORTS_MODULE_ID index ,
20733  PORTS_CN_PIN cnPins ) ;
20734 // *****************************************************************************
20735 /* Function:
20736  void PLIB_PORTS_ChangeNoticeEnable( PORTS_MODULE_ID index )
20737  Summary:
20738  Global Change Notice enable.
20739  Description:
20740  This function enables the global Change Notice feature.
20741  This function performs atomic register access.
20742  Precondition:
20743  None.
20744  Parameters:
20745  index - Identifier for the device instance to be configured
20746  Returns:
20747  None.
20748  Example:
20749  <code>
20750 
20751  // Enable Change Notification
20752  PLIB_PORTS_ChangeNoticeEnable(PORTS_ID_0);
20753 
20754  </code>
20755  Remarks:
20756  This function is only available in devices without PPS. For PPS devices, use the
20757  PLIB_PORTS_ChangeNoticePerPortTurnOn function.
20758 
20759  This feature may not be available on all devices. Please refer to the
20760  specific device data sheet to determine availability or use
20761  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20762  this feature is available.
20763 */
20764 
20765 void
20767  PORTS_MODULE_ID index ) ;
20768 // *****************************************************************************
20769 /* Function:
20770  void PLIB_PORTS_ChangeNoticeDisable( PORTS_MODULE_ID index )
20771  Summary:
20772  Global Change Notice disable.
20773  Description:
20774  This function disables the global Change Notice feature.
20775  Precondition:
20776  None.
20777  Parameters:
20778  index - Identifier for the device instance to be configured
20779  Returns:
20780  None.
20781  Example:
20782  <code>
20783 
20784  // Disable Change Notification
20785  PLIB_PORTS_ChangeNoticeDisable(PORTS_ID_0);
20786 
20787  </code>
20788  Remarks:
20789  This function is only available in devices without PPS. For PPS devices, use the
20790  PLIB_PORTS_ChangeNoticePerPortTurnOff function.
20791 
20792  This feature may not be available on all devices. Please refer to the
20793  specific device data sheet to determine availability or use
20794  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20795  this feature is available.
20796 */
20797 
20798 void
20800  PORTS_MODULE_ID index ) ;
20801 // *****************************************************************************
20802 /* Function:
20803  void PLIB_PORTS_PinChangeNoticeEnable( PORTS_MODULE_ID index,
20804  PORTS_CHANGE_NOTICE_PIN pinNum )
20805  Summary:
20806  Port pin Change Notice interrupt enable.
20807  Description:
20808  This function enables the port pin Change Notice feature.
20809  This function performs atomic register access.
20810  Precondition:
20811  None.
20812  Parameters:
20813  index - Identifier for the device instance to be configured
20814  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20815  Returns:
20816  None.
20817  Example:
20818  <code>
20819 
20820  // Enable Change Notice interrupt for pin CN13
20821  PLIB_PORTS_PinChangeNoticeEnable(PORTS_ID_0, CN13);
20822 
20823  </code>
20824  Remarks:
20825  This function is only available in devices without PPS. For PPS devices, use the
20826  PLIB_PORTS_PinChangeNoticePerPortEnable function.
20827 
20828  This feature may not be available on all devices. Please refer to the
20829  specific device data sheet to determine availability or use
20830  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20831  this feature is available.
20832 */
20833 
20834 void
20836  PORTS_MODULE_ID index ,
20837  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20838 // *****************************************************************************
20839 /* Function:
20840  void PLIB_PORTS_PinChangeNoticeDisable( PORTS_MODULE_ID index,
20841  PORTS_CHANGE_NOTICE_PIN pinNum )
20842  Summary:
20843  Port pin Change Notice disable.
20844  Description:
20845  This function disables the port pin Change Notice feature.
20846  This function performs atomic register access.
20847  Precondition:
20848  None.
20849  Parameters:
20850  index - Identifier for the device instance to be configured
20851  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20852  Returns:
20853  None.
20854  Example:
20855  <code>
20856 
20857  // Disable Change Notice interrupt for pin CN13
20858  PLIB_PORTS_PinChangeNoticeDisable(PORTS_ID_0, CN13);
20859 
20860  </code>
20861  Remarks:
20862  This function is only available in devices without PPS. For PPS devices, use the
20863  PLIB_PORTS_PinChangeNoticePerPortDisable function.
20864 
20865  This feature may not be available on all devices. Please refer to the
20866  specific device data sheet to determine availability or use
20867  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20868  this feature is available.
20869 */
20870 
20871 void
20873  PORTS_MODULE_ID index ,
20874  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20875 // *****************************************************************************
20876 /* Function:
20877  void PLIB_PORTS_ChangeNoticeInIdleEnable( PORTS_MODULE_ID index )
20878  Summary:
20879  CPU Idle mode does not affect Change Notice operation.
20880  Description:
20881  This function makes sure that Change Notice feature continues working in
20882  Idle mode.
20883  This function performs atomic register access.
20884 
20885  Precondition:
20886  None.
20887  Parameters:
20888  index - Identifier for the device instance to be configured
20889  Returns:
20890  None.
20891  Example:
20892  <code>
20893 
20894  // Change notification feature will be working even when CPU goes to
20895  // Idle mode
20896  PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_ID_0);
20897 
20898  </code>
20899  Remarks:
20900  This function is only available in devices without PPS. For PPS devices, use the
20901  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable function.
20902 
20903  This feature may not be available on all devices. Please refer to the
20904  specific device data sheet to determine availability or use
20905  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20906  this feature is available.
20907 */
20908 
20909 void
20911  PORTS_MODULE_ID index ) ;
20912 // *****************************************************************************
20913 /* Function:
20914  void PLIB_PORTS_ChangeNoticeInIdleDisable( PORTS_MODULE_ID index )
20915  Summary:
20916  CPU Idle halts the Change Notice operation.
20917  Description:
20918  This function halts the Change Notice operation when the CPU enters
20919  Idle mode.
20920  This function performs atomic register access.
20921  Precondition:
20922  None.
20923  Parameters:
20924  index - Identifier for the device instance to be configured
20925  Returns:
20926  None.
20927  Example:
20928  <code>
20929  // Halts the Change notification operation when CPU enters Idle mode
20930  PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_ID_0);
20931 
20932  </code>
20933  Remarks:
20934  This function is only available in devices without PPS. For PPS devices, use the
20935  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable function.
20936 
20937  This feature may not be available on all devices. Please refer to the
20938  specific device data sheet to determine availability or use
20939  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20940  this feature is available.
20941 */
20942 
20943 void
20945  PORTS_MODULE_ID index ) ;
20946 // *****************************************************************************
20947 /* Function:
20948  void PLIB_PORTS_ChangeNoticePullUpEnable( PORTS_MODULE_ID index,
20949  PORTS_CHANGE_NOTICE_PIN pinNum )
20950  Summary:
20951  Enable pull-up on input change.
20952  Description:
20953  This function enables pull-up on selected input change notification pin.
20954  This function performs atomic register access.
20955  Precondition:
20956  None.
20957  Parameters:
20958  index - Identifier for the device instance to be configured
20959  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20960  Returns:
20961  None.
20962  Example:
20963  <code>
20964 
20965  // Enable pull-up on pin CN13
20966  PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_ID_0, CN13);
20967 
20968  </code>
20969  Remarks:
20970  This function is only available in devices without PPS. For PPS devices, use the
20971  PLIB_PORTS_ChangeNoticePullUpPerPortEnable function.
20972 
20973  This feature may not be available on all devices. Please refer to the
20974  specific device data sheet to determine availability or use
20975  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20976  this feature is available.
20977 */
20978 
20979 void
20981  PORTS_MODULE_ID index ,
20982  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20983 // *****************************************************************************
20984 /* Function:
20985  void PLIB_PORTS_ChangeNoticePullUpDisable( PORTS_MODULE_ID index,
20986  PORTS_CHANGE_NOTICE_PIN pinNum )
20987  Summary:
20988  Disable pull-up on input change.
20989  Description:
20990  This function disables pull-up on selected input change notification pin.
20991  This function performs atomic register access.
20992  Precondition:
20993  None.
20994  Parameters:
20995  index - Identifier for the device instance to be configured
20996  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20997  Returns:
20998  None.
20999  Example:
21000  <code>
21001 
21002  // Disable pull-up on pin CN13
21003  PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_ID_0, CN13);
21004 
21005  </code>
21006  Remarks:
21007  This function is only available in devices without PPS. For PPS devices, use the
21008  PLIB_PORTS_ChangeNoticePullUpPerPortDisable function.
21009 
21010  This feature may not be available on all devices. Please refer to the
21011  specific device data sheet to determine availability or use
21012  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
21013  this feature is available.
21014 */
21015 
21016 void
21018  PORTS_MODULE_ID index ,
21019  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
21020 // *****************************************************************************
21021 /* Function:
21022  void PLIB_PORTS_ChannelSlewRateSelect
21023  (
21024  PORTS_MODULE_ID index,
21025  PORTS_CHANNEL channel,
21026  PORTS_DATA_MASK channelMask,
21027  PORTS_PIN_SLEW_RATE slewRate
21028  );
21029  Summary:
21030  Selects the slew rate for selected channel pins.
21031  Description:
21032  This function selects the slew rate for selected channel pins.
21033  This function does not perform atomic register access.
21034  Precondition:
21035  None.
21036  Parameters:
21037  index - Identifier for the device instance to be configured
21038  channel - Port pin channel
21039  channelMask - Identifies the pins for which slew rate has to be modified.
21040  Slew rate of the pins which corresponding bit is "1" get
21041  modified, slew rate of the other pins remains the same.
21042  slewRate - One of the possible values of PORTS_PIN_SLEW_RATE.
21043  Returns:
21044  None.
21045  Example:
21046  <code>
21047 
21048  // Make slew rate of pins RC5, RC8 and RC13 slowest
21049  PLIB_PORTS_ChannelSlewRateSelect(PORTS_ID_0,
21050  PORT_CHANNEL_C,
21051  0x2120,
21052  PORTS_PIN_SLEW_RATE_SLOWEST);
21053 
21054  </code>
21055  Remarks:
21056  This feature may not be available on all devices. Please refer to the
21057  specific device data sheet to determine availability or use
21058  PLIB_PORTS_ExistsSlewRateControl in your application to determine
21059  whether this feature is available.
21060 */
21061 
21062 void
21064  PORTS_MODULE_ID index ,
21065  PORTS_CHANNEL channel ,
21066  PORTS_DATA_MASK channelMask ,
21067  PORTS_PIN_SLEW_RATE slewRate ) ;
21068 // *****************************************************************************
21069 /* Function:
21070 PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet
21071  (
21072  PORTS_MODULE_ID index,
21073  PORTS_CHANNEL channel,
21074  PORTS_BIT_POS bitPos
21075  );
21076  Summary:
21077  Gets the slew rate for selected port pin.
21078  Description:
21079  This function gets the slew rate of selected port pin.
21080  This function does not perform atomic register access.
21081  Precondition:
21082  None.
21083  Parameters:
21084  index - Identifier for the device instance to be configured
21085  channel - Port pin channel
21086  bitPos - One of the possible values of PORTS_BIT_POS.
21087  Returns:
21088  One of the possible values of PORTS_PIN_SLEW_RATE.
21089  Example:
21090  <code>
21091  PORTS_PIN_SLEW_RATE slewRate;
21092 
21093  // Get the slew rate of pin RC1
21094  slewRate = PLIB_PORTS_PinSlewRateGet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1);
21095 
21096  </code>
21097  Remarks:
21098  This feature may not be available on all devices. Please refer to the
21099  specific device data sheet to determine availability or use
21100  PLIB_PORTS_ExistsSlewRateControl in your application to determine
21101  whether this feature is available.
21102 */
21103 
21104 PORTS_PIN_SLEW_RATE
21106  PORTS_MODULE_ID index ,
21107  PORTS_CHANNEL channel ,
21108  PORTS_BIT_POS bitPos ) ;
21109 // *****************************************************************************
21110 /* Function:
21111  void PLIB_PORTS_ChannelChangeNoticeMethodSelect
21112  (
21113  PORTS_MODULE_ID index,
21114  PORTS_CHANNEL channel,
21115  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod
21116  );
21117  Summary:
21118  Selects the Change Notice style for selected port channel.
21119  Description:
21120  This function selects the Change Notice style (or method) for selected port
21121  channel. It allows user to select whether the Change Notice detection will
21122  happen based on edge transition or level transition on all the CN pins of a
21123  particular channel.
21124  This function does not perform atomic register access.
21125  Precondition:
21126  None.
21127  Parameters:
21128  index - Identifier for the device instance to be configured
21129  channel - Port pin channel
21130  changeNoticeMethod - One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
21131  Returns:
21132  None.
21133  Example:
21134  <code>
21135  PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_ID_0, PORT_CHANNEL_C,
21136  PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT);
21137  </code>
21138  Remarks:
21139  This feature may not be available on all devices. Please refer to the
21140  specific device data sheet to determine availability or use
21141  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
21142  whether this feature is available.
21143 */
21144 
21145 void
21147  PORTS_MODULE_ID index ,
21148  PORTS_CHANNEL channel ,
21149  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod ) ;
21150 // *****************************************************************************
21151 /* Function:
21152  PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet
21153  (
21154  PORTS_MODULE_ID index,
21155  PORTS_CHANNEL channel
21156  );
21157  Summary:
21158  Gets the Change Notice style for the selected port channel.
21159  Description:
21160  This function gets the Change Notice style (or method) for the selected port
21161  channel.
21162  This function does not perform atomic register access.
21163  Precondition:
21164  None.
21165  Parameters:
21166  index - Identifier for the device instance to be configured
21167  channel - Port pin channel
21168  Returns:
21169  One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
21170  Example:
21171  <code>
21172  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod;
21173  changeNoticeMethod = PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_ID_0, PORT_CHANNEL_C);
21174  </code>
21175  Remarks:
21176  This feature may not be available on all devices. Please refer to the
21177  specific device data sheet to determine availability or use
21178  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
21179  whether this feature is available.
21180 */
21181 
21182 PORTS_CHANGE_NOTICE_METHOD
21184  PORTS_MODULE_ID index ,
21185  PORTS_CHANNEL channel ) ;
21186 // *****************************************************************************
21187 /* Function:
21188  void PLIB_PORTS_ChannelChangeNoticeEdgeEnable
21189  (
21190  PORTS_MODULE_ID index,
21191  PORTS_CHANNEL channel,
21192  PORTS_DATA_MASK edgeRisingMask,
21193  PORTS_DATA_MASK edgeFallingMask
21194  );
21195  Summary:
21196  Enables selected type of edge for selected CN pins.
21197  Description:
21198  This function Enables selected type of edge (falling or rising) for
21199  selected CN pins of a port channel.
21200  This function does not perform atomic register access.
21201  Precondition:
21202  Change Notice method should be selected as
21203  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
21204  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
21205  Parameters:
21206  index - Identifier for the device instance to be configured
21207  channel - Port pin channel
21208  edgeRisingMask - Identifies the pins for which Change Notice has to be
21209  enabled for rising edge. Change Notice interrupt at rising
21210  edge is enabled for the pins which corresponding bit is
21211  '1', for the other pins it remains the same.
21212  edgeFallingMask - Identifies the pins for which Change Notice has to be
21213  enabled for falling edge. Change Notice interrupt at
21214  falling edge is enabled for the pins which corresponding
21215  bit is '1', for the other pins it remains the same.
21216  Returns:
21217  None.
21218  Example:
21219  <code>
21220  // Enable Change Notice at rising edge for RC1 pin and at falling edge for
21221  // RC1 & RC5 pins.
21222  PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
21223  </code>
21224  Remarks:
21225  This feature is not available on all devices. Please refer to the
21226  specific device data sheet to determine availability or use
21227  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
21228  whether this feature is available.
21229 */
21230 
21231 void
21233  PORTS_MODULE_ID index ,
21234  PORTS_CHANNEL channel ,
21235  PORTS_DATA_MASK edgeRisingMask ,
21236  PORTS_DATA_MASK edgeFallingMask ) ;
21237 // *****************************************************************************
21238 /* Function:
21239  void PLIB_PORTS_ChannelChangeNoticeEdgeDisable
21240  (
21241  PORTS_MODULE_ID index,
21242  PORTS_CHANNEL channel,
21243  PORTS_DATA_MASK edgeRisingMask,
21244  PORTS_DATA_MASK edgeFallingMask
21245  );
21246  Summary:
21247  Disables selected type of edge for selected CN pins.
21248  Description:
21249  This function Disables selected type of edge (falling or rising) for
21250  selected CN pins of a port channel.
21251  This function does not perform atomic register access.
21252  Precondition:
21253  Change Notice method should be selected as
21254  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
21255  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
21256  Parameters:
21257  index - Identifier for the device instance to be configured
21258  channel - Port pin channel
21259  edgeRisingMask - Identifies the pins for which Change Notice has to be
21260  enabled for rising edge. Change notice interrupt at rising
21261  edge is enabled for the pins which corresponding bit is
21262  '1', for the other pins it remains the same.
21263  edgeFallingMask - Identifies the pins for which Change Notice has to be
21264  enabled for falling edge. Change notice interrupt at
21265  falling edge is enabled for the pins which corresponding
21266  bit is '1', for the other pins it remains the same.
21267  Returns:
21268  None.
21269  Example:
21270  <code>
21271  // Disable Change Notice at rising edge for RC1 pin and at falling edge for
21272  // RC1 & RC5 pins.
21273  PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
21274  </code>
21275  Remarks:
21276  This feature is not available on all devices. Please refer to the
21277  specific device data sheet to determine availability or use
21278  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
21279  whether this feature is available.
21280 */
21281 
21282 void
21284  PORTS_MODULE_ID index ,
21285  PORTS_CHANNEL channel ,
21286  PORTS_DATA_MASK edgeRisingMask ,
21287  PORTS_DATA_MASK edgeFallingMask ) ;
21288 // *****************************************************************************
21289 /* Function:
21290  bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
21291  (
21292  PORTS_MODULE_ID index,
21293  PORTS_CHANNEL channel,
21294  PORTS_BIT_POS bitPos,
21295  PORTS_CHANGE_NOTICE_EDGE cnEdgeType
21296  );
21297  Summary:
21298  Check if Change Notice edge is enabled or not.
21299  This function does not perform atomic register access.
21300  Description:
21301  This function checks if selected type of Change Notice edge is enabled on a
21302  particular port pin or not.
21303  This function does not perform atomic register access.
21304  Precondition:
21305  None.
21306  Parameters:
21307  index - Identifier for the device instance to be configured
21308  channel - Port pin channel
21309  bitPos - One of the possible values of PORTS_BIT_POS.
21310  cnEdgeType - Type of the edge which has to be checked.
21311 
21312  Returns:
21313  - true - Selected type of Change Notice Edge is enabled.
21314  - false - Selected type of Change Notice Edge is not enabled.
21315 
21316  Example:
21317  <code>
21318  // Check if Change Notice at rising edge is enabled or not for pin RC1.
21319  if (PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1, PORTS_CHANGE_NOTICE_EDGE_RISING))
21320  {
21321  // do something
21322  }
21323  </code>
21324  Remarks:
21325  This feature is not available on all devices. Please refer to the
21326  specific device data sheet to determine availability or use
21327  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
21328  whether this feature is available.
21329 */
21330 
21331 bool
21333  PORTS_MODULE_ID index ,
21334  PORTS_CHANNEL channel ,
21335  PORTS_BIT_POS bitPos ,
21336  PORTS_CHANGE_NOTICE_EDGE cnEdgeType ) ;
21337 // *****************************************************************************
21338 /* Function:
21339  bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
21340  (
21341  PORTS_MODULE_ID index,
21342  PORTS_CHANNEL channel,
21343  PORTS_BIT_POS bitPos
21344  );
21345  Summary:
21346  Check Change Notice edge status.
21347  Description:
21348  This function checks whether or no a Change Notice edge transition has occurred
21349  on the selected port pin.
21350  This function does not perform atomic register access.
21351  Precondition:
21352  None.
21353  Parameters:
21354  index - Identifier for the device instance to be configured
21355  channel - Port pin channel
21356  bitPos - One of the possible values of PORTS_BIT_POS
21357 
21358  Returns:
21359  - true - Change Notice edge transition has occurred
21360  - false - Change Notice edge transition has not occurred
21361 
21362  Example:
21363  <code>
21364  // Check if Change Notice edge transition has occurred for pin RC1.
21365  if (PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1))
21366  {
21367  // do something
21368  }
21369  </code>
21370  Remarks:
21371  This feature is not available on all devices. Please refer to the
21372  specific device data sheet to determine availability or use
21373  PLIB_PORTS_ExistsChangeNoticeEdgeStatus in your application to determine
21374  whether this feature is available.
21375 */
21376 
21377 bool
21379  PORTS_MODULE_ID index ,
21380  PORTS_CHANNEL channel ,
21381  PORTS_BIT_POS bitPos ) ;
21382 // *****************************************************************************
21383 // *****************************************************************************
21384 // Section: Ports Peripheral Library Exists Functions
21385 // *****************************************************************************
21386 // *****************************************************************************
21387 /* The functions below indicate the existence of the features on the device.
21388 */
21389 //******************************************************************************
21390 /* Function:
21391  PLIB_PORTS_ExistsRemapInput( PORTS_MODULE_ID index )
21392  Summary:
21393  Identifies whether the RemapInput feature exists on the Ports module.
21394  Description:
21395  This function identifies whether the RemapInput feature is available on the
21396  Ports module.
21397  When this function returns true, this function is supported on the device:
21398  - PLIB_PORTS_RemapInput
21399  Preconditions:
21400  None.
21401  Parameters:
21402  index - Identifier for the device instance
21403  Returns:
21404  - true - The RemapInput feature is supported on the device
21405  - false - The RemapInput feature is not supported on the device
21406  Remarks:
21407  None.
21408 */
21409 
21410 bool
21412  PORTS_MODULE_ID index ) ;
21413 //******************************************************************************
21414 /* Function:
21415  PLIB_PORTS_ExistsRemapOutput( PORTS_MODULE_ID index )
21416  Summary:
21417  Identifies whether the RemapOutput feature exists on the Ports module.
21418  Description:
21419  This function identifies whether the RemapOutput feature is available on the
21420  Ports module.
21421  When this function returns true, this function is supported on the device:
21422  - PLIB_PORTS_RemapOutput
21423  Preconditions:
21424  None.
21425  Parameters:
21426  index - Identifier for the device instance
21427  Returns:
21428  - true - The RemapOutput feature is supported on the device
21429  - false - The RemapOutput feature is not supported on the device
21430  Remarks:
21431  None.
21432 */
21433 
21434 bool
21436  PORTS_MODULE_ID index ) ;
21437 //******************************************************************************
21438 /* Function:
21439  PLIB_PORTS_ExistsPinMode( PORTS_MODULE_ID index )
21440  Summary:
21441  Identifies whether the PinMode feature exists on the Ports module.
21442  Description:
21443  This function identifies whether the PinMode (Analog Pin or Digital Pin)
21444  feature is available on the Ports module.
21445  When this function returns true, this function is supported on the device:
21446  - PLIB_PORTS_PinModeSelect
21447  Preconditions:
21448  None.
21449  Parameters:
21450  index - Identifier for the device instance
21451  Returns:
21452  - true - The PinMode feature is supported on the device
21453  - false - The PinMode feature is not supported on the device
21454  Remarks:
21455  None.
21456 */
21457 
21458 bool
21460  PORTS_MODULE_ID index ) ;
21461 //******************************************************************************
21462 /* Function:
21463  PLIB_PORTS_ExistsAnPinsMode( PORTS_MODULE_ID index )
21464  Summary:
21465  Identifies whether the AnPinsMode feature exists on the Ports module.
21466  Description:
21467  This function identifies whether the AnPinsMode feature is available on the
21468  Ports module.
21469  When this function returns true, this function is supported on the device:
21470  - PLIB_PORTS_AnPinsModeSelect
21471  Preconditions:
21472  None.
21473  Parameters:
21474  index - Identifier for the device instance
21475  Returns:
21476  - true - The AnPinsMode feature is supported on the device
21477  - false - The AnPinsMode feature is not supported on the device
21478  Remarks:
21479  None.
21480 */
21481 
21482 bool
21484  PORTS_MODULE_ID index ) ;
21485 //******************************************************************************
21486 /* Function:
21487  PLIB_PORTS_ExistsPortsRead( PORTS_MODULE_ID index )
21488  Summary:
21489  Identifies whether the PortsRead feature exists on the Ports module.
21490  Description:
21491  This function identifies whether the PortsRead feature is available on the
21492  Ports module.
21493  When this function returns true, these functions are supported on the device:
21494  - PLIB_PORTS_PinGet
21495  - PLIB_PORTS_Read
21496  Preconditions:
21497  None.
21498  Parameters:
21499  index - Identifier for the device instance
21500  Returns:
21501  - true - The PortsRead feature is supported on the device
21502  - false - The PortsRead feature is not supported on the device
21503  Remarks:
21504  None.
21505 */
21506 
21507 bool
21509  PORTS_MODULE_ID index ) ;
21510 //******************************************************************************
21511 /* Function:
21512  PLIB_PORTS_ExistsLatchRead( PORTS_MODULE_ID index )
21513  Summary:
21514  Identifies whether the LatchRead feature exists on the Ports module.
21515  Description:
21516  This function identifies whether the LatchRead feature is available on the
21517  Ports module.
21518  When this function returns true, these functions are supported on the device:
21519  - PLIB_PORTS_PinGetLatched
21520  - PLIB_PORTS_ReadLatched
21521  Preconditions:
21522  None.
21523  Parameters:
21524  index - Identifier for the device instance
21525  Returns:
21526  - true - The LatchRead feature is supported on the device
21527  - false - The LatchRead feature is not supported on the device
21528  Remarks:
21529  None.
21530 */
21531 
21532 bool
21534  PORTS_MODULE_ID index ) ;
21535 //******************************************************************************
21536 /* Function:
21537  PLIB_PORTS_ExistsPortsWrite( PORTS_MODULE_ID index )
21538  Summary:
21539  Identifies whether the PortsWrite feature exists on the Ports module.
21540  Description:
21541  This function identifies whether the PortsWrite feature is available on the
21542  Ports module.
21543  When this function returns true, these functions are supported on the device:
21544  - PLIB_PORTS_PinWrite
21545  - PLIB_PORTS_PinSet
21546  - PLIB_PORTS_PinClear
21547  - PLIB_PORTS_PinToggle
21548  - PLIB_PORTS_Write
21549  - PLIB_PORTS_Set
21550  - PLIB_PORTS_Toggle
21551  - PLIB_PORTS_Clear
21552  Preconditions:
21553  None.
21554  Parameters:
21555  index - Identifier for the device instance
21556  Returns:
21557  - true - The PortsWrite feature is supported on the device
21558  - false - The PortsWrite feature is not supported on the device
21559  Remarks:
21560  None.
21561 */
21562 
21563 bool
21565  PORTS_MODULE_ID index ) ;
21566 //******************************************************************************
21567 /* Function:
21568  PLIB_PORTS_ExistsPortsDirection( PORTS_MODULE_ID index )
21569  Summary:
21570  Identifies whether the PortsDirection feature exists on the Ports module.
21571  Description:
21572  This function identifies whether the PortsDirection feature is available on the
21573  Ports module.
21574  When this function returns true, these functions are supported on the device:
21575  - PLIB_PORTS_PinDirectionInputSet
21576  - PLIB_PORTS_PinDirectionOutputSet
21577  - PLIB_PORTS_DirectionInputSet
21578  - PLIB_PORTS_DirectionOutputSet
21579  - PLIB_PORTS_DirectionGet
21580  Preconditions:
21581  None.
21582  Parameters:
21583  index - Identifier for the device instance
21584  Returns:
21585  - true - The PortsDirection feature is supported on the device
21586  - false - The PortsDirection feature is not supported on the device
21587  Remarks:
21588  None.
21589 */
21590 
21591 bool
21593  PORTS_MODULE_ID index ) ;
21594 //******************************************************************************
21595 /* Function:
21596  PLIB_PORTS_ExistsPortsOpenDrain( PORTS_MODULE_ID index )
21597  Summary:
21598  Identifies whether the PortsOpenDrain feature exists on the Ports module.
21599  Description:
21600  This function identifies whether the PortsOpenDrain feature is available on
21601  the Ports module.
21602  When this function returns true, these functions are supported on the device:
21603  - PLIB_PORTS_PinOpenDrainEnable
21604  - PLIB_PORTS_PinOpenDrainDisable
21605  - PLIB_PORTS_OpenDrainEnable
21606  - PLIB_PORTS_OpenDrainDisable
21607  Preconditions:
21608  None.
21609  Parameters:
21610  index - Identifier for the device instance
21611  Returns:
21612  - true - The PortsOpenDrain feature is supported on the device
21613  - false - The PortsOpenDrain feature is not supported on the device
21614  Remarks:
21615  None.
21616 */
21617 
21618 bool
21620  PORTS_MODULE_ID index ) ;
21621 //******************************************************************************
21622 /* Function:
21623  PLIB_PORTS_ExistsChangeNotice( PORTS_MODULE_ID index )
21624  Summary:
21625  Identifies whether the ChangeNotice feature exists on the Ports module.
21626  Description:
21627  This function identifies whether the ChangeNotice feature is available on the
21628  Ports module.
21629  When this function returns true, these functions are supported on the device:
21630  - PLIB_PORTS_ChangeNoticeEnable
21631  - PLIB_PORTS_ChangeNoticeDisable
21632  Preconditions:
21633  None.
21634  Parameters:
21635  index - Identifier for the device instance
21636  Returns:
21637  - true - The ChangeNotice feature is supported on the device
21638  - false - The ChangeNotice feature is not supported on the device
21639  Remarks:
21640  None.
21641 */
21642 
21643 bool
21645  PORTS_MODULE_ID index ) ;
21646 //******************************************************************************
21647 /* Function:
21648  PLIB_PORTS_ExistsPinChangeNotice( PORTS_MODULE_ID index )
21649  Summary:
21650  Identifies whether the PinChangeNotice feature exists on the Ports module.
21651  Description:
21652  This function identifies whether the PinChangeNotice feature is available on
21653  the Ports module.
21654  When this function returns true, these functions are supported on the device:
21655  - PLIB_PORTS_PinChangeNoticeEnable
21656  - PLIB_PORTS_PinChangeNoticeDisable
21657  - PLIB_PORTS_CnPinsEnable
21658  - PLIB_PORTS_CnPinsDisable
21659  Preconditions:
21660  None.
21661  Parameters:
21662  index - Identifier for the device instance
21663  Returns:
21664  - true - The PinChangeNotice feature is supported on the device
21665  - false - The PinChangeNotice feature is not supported on the device
21666  Remarks:
21667  None.
21668 */
21669 
21670 bool
21672  PORTS_MODULE_ID index ) ;
21673 //******************************************************************************
21674 /* Function:
21675  PLIB_PORTS_ExistsChangeNoticeInIdle( PORTS_MODULE_ID index )
21676  Summary:
21677  Identifies whether the ChangeNoticeInIdle feature exists on the Ports module.
21678  Description:
21679  This function identifies whether the ChangeNoticeInIdle feature is available
21680  on the Ports module.
21681  When this function returns true, these functions are supported on the device:
21682  - PLIB_PORTS_ChangeNoticeInIdleEnable
21683  - PLIB_PORTS_ChangeNoticeInIdleDisable
21684  Preconditions:
21685  None.
21686  Parameters:
21687  index - Identifier for the device instance
21688  Returns:
21689  - true - The ChangeNoticeInIdle feature is supported on the device
21690  - false - The ChangeNoticeInIdle feature is not supported on the device
21691  Remarks:
21692  None.
21693 */
21694 
21695 bool
21697  PORTS_MODULE_ID index ) ;
21698 //******************************************************************************
21699 /* Function:
21700  PLIB_PORTS_ExistsChangeNoticePullUp( PORTS_MODULE_ID index )
21701  Summary:
21702  Identifies whether the ChangeNoticePullup feature exists on the Ports module.
21703  Description:
21704  This function identifies whether the ChangeNoticePullup feature is available
21705  on the Ports module.
21706  When this function returns true, these functions are supported on the device:
21707  - PLIB_PORTS_ChangeNoticePullUpEnable
21708  - PLIB_PORTS_ChangeNoticePullUpDisable
21709  - PLIB_PORTS_CnPinsPullUpEnable
21710  - PLIB_PORTS_CnPinsPullUpDisable
21711  Preconditions:
21712  None.
21713  Parameters:
21714  index - Identifier for the device instance
21715  Returns:
21716  - true - The ChangeNoticePullup feature is supported on the device
21717  - false - The ChangeNoticePullup feature is not supported on the device
21718  Remarks:
21719  None.
21720 */
21721 
21722 bool
21724  PORTS_MODULE_ID index ) ;
21725 //******************************************************************************
21726 /* Function:
21727  PLIB_PORTS_ExistsPinModePerPort( PORTS_MODULE_ID index )
21728  Summary:
21729  Identifies whether the PinModePerPort feature exists on the Ports module.
21730  Description:
21731  This function identifies whether the PinModePerPort (Analog Pin or Digital Pin)
21732  feature is available on the Ports module.
21733  When this function returns true, these functions are supported on the device:
21734  - PLIB_PORTS_PinModePerPortSelect
21735  - PLIB_PORTS_ChannelModeSelect
21736  Preconditions:
21737  None.
21738  Parameters:
21739  index - Identifier for the device instance
21740  Returns:
21741  - true - The PinModePerPort feature is supported on the device
21742  - false - The PinModePerPort feature is not supported on the device
21743  Remarks:
21744  None.
21745 */
21746 
21747 bool
21749  PORTS_MODULE_ID index ) ;
21750 //******************************************************************************
21751 /* Function:
21752  PLIB_PORTS_ExistsChangeNoticePullDownPerPort( PORTS_MODULE_ID index )
21753  Summary:
21754  Identifies whether the ChangeNoticePullDownPerPort feature exists on the
21755  Ports module.
21756  Description:
21757  This function identifies whether the ChangeNoticePullDownPerPort feature is
21758  available on the Ports module.
21759  When this function returns true, these functions are supported on the device:
21760  - PLIB_PORTS_ChangeNoticePullDownPerPortEnable
21761  - PLIB_PORTS_ChangeNoticePullDownPerPortDisable
21762  - PLIB_PORTS_ChannelChangeNoticePullDownEnable
21763  - PLIB_PORTS_ChannelChangeNoticePullDownDisable
21764  Preconditions:
21765  None.
21766  Parameters:
21767  index - Identifier for the device instance
21768  Returns:
21769  - true - The ChangeNoticePullDownPerPort feature is supported on the device
21770  - false - The ChangeNoticePullDownPerPort feature is not supported on the device
21771  Remarks:
21772  None.
21773 */
21774 
21775 bool
21777  PORTS_MODULE_ID index ) ;
21778 //******************************************************************************
21779 /* Function:
21780  PLIB_PORTS_ExistsChangeNoticePullUpPerPort( PORTS_MODULE_ID index )
21781  Summary:
21782  Identifies whether the ChangeNoticePullUpPerPort feature exists on the Ports
21783  module.
21784  Description:
21785  This function identifies whether the ChangeNoticePullUpPerPort feature is available
21786  on the Ports module.
21787  When this function returns true, these functions are supported on the device:
21788  - PLIB_PORTS_ChangeNoticePullUpPerPortEnable
21789  - PLIB_PORTS_ChangeNoticePullUpPerPortDisable
21790  - PLIB_PORTS_ChannelChangeNoticePullUpEnable
21791  - PLIB_PORTS_ChannelChangeNoticePullUpDisable
21792  Preconditions:
21793  None.
21794  Parameters:
21795  index - Identifier for the device instance
21796  Returns:
21797  - true - The ChangeNoticePullUpPerPort feature is supported on the device
21798  - false - The ChangeNoticePullUpPerPort feature is not supported on the device
21799  Remarks:
21800  None.
21801 */
21802 
21803 bool
21805  PORTS_MODULE_ID index ) ;
21806 //******************************************************************************
21807 /* Function:
21808  PLIB_PORTS_ExistsPinChangeNoticePerPort( PORTS_MODULE_ID index )
21809  Summary:
21810  Identifies whether the PinChangeNoticePerPort feature exists on the Ports
21811  module.
21812  Description:
21813  This function identifies whether the PinChangeNoticePerPort feature is
21814  available on the Ports module.
21815  When this function returns true, these functions are supported on the device:
21816  - PLIB_PORTS_PinChangeNoticePerPortEnable
21817  - PLIB_PORTS_PinChangeNoticePerPortDisable
21818  - PLIB_PORTS_ChannelChangeNoticeEnable
21819  - PLIB_PORTS_ChannelChangeNoticeDisable
21820  Preconditions:
21821  None.
21822  Parameters:
21823  index - Identifier for the device instance
21824  Returns:
21825  - true - The PinChangeNoticePerPort feature is supported on the device
21826  - false - The PinChangeNoticePerPort feature is not supported on the device
21827  Remarks:
21828  None.
21829 */
21830 
21831 bool
21833  PORTS_MODULE_ID index ) ;
21834 //******************************************************************************
21835 /* Function:
21836  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn( PORTS_MODULE_ID index )
21837  Summary:
21838  Identifies whether the ChangeNoticePerPortTurnOn feature exists on the Ports
21839  module.
21840  Description:
21841  This function identifies whether the ChangeNoticePerPortTurnOn feature is
21842  available on the Ports module.
21843  When this function returns true, these functions are supported on the device:
21844  - PLIB_PORTS_ChangeNoticePerPortTurnOn
21845  - PLIB_PORTS_ChangeNoticePerPortTurnOff
21846  Preconditions:
21847  None.
21848  Parameters:
21849  index - Identifier for the device instance
21850  Returns:
21851  - true - The ChangeNoticePerPortTurnOn feature is supported on the device
21852  - false - The ChangeNoticePerPortTurnOn feature is not supported on the device
21853  Remarks:
21854  None.
21855 */
21856 
21857 bool
21859  PORTS_MODULE_ID index ) ;
21860 //******************************************************************************
21861 /* Function:
21862  PLIB_PORTS_ExistsChangeNoticePerPortInIdle( PORTS_MODULE_ID index )
21863  Summary:
21864  Identifies whether the ChangeNoticeInIdlePerPort feature exists on the Ports
21865  module.
21866  Description:
21867  This function identifies whether the ChangeNoticeInIdlePerPort feature is
21868  available on the Ports module.
21869  When this function returns true, these functions are supported on the device:
21870  - PLIB_PORTS_ChangeNoticeInIdlePerPortEnable
21871  - PLIB_PORTS_ChangeNoticeInIdlePerPortDisable
21872  Preconditions:
21873  None.
21874  Parameters:
21875  index - Identifier for the device instance
21876  Returns:
21877  - true - The ChangeNoticeInIdlePerPort feature is supported on the device
21878  - false - The ChangeNoticeInIdlePerPort feature is not supported on the device
21879  Remarks:
21880  None.
21881 */
21882 
21883 bool
21885  PORTS_MODULE_ID index ) ;
21886 //******************************************************************************
21887 /* Function:
21888  PLIB_PORTS_ExistsChangeNoticePerPortStatus( PORTS_MODULE_ID index )
21889  Summary:
21890  Identifies whether the ChangeNoticePerPortStatus feature exists on the Ports
21891  module.
21892  Description:
21893  This function identifies whether the ChangeNoticePerPortStatus feature is
21894  available on the Ports module.
21895  When this function returns true, these functions are supported on the device:
21896  - PLIB_PORTS_ChangeNoticePerPortHasOccured
21897  - PLIB_PORTS_ChangeNoticePerPortHasOccurred
21898  Preconditions:
21899  None.
21900  Parameters:
21901  index - Identifier for the device instance
21902  Returns:
21903  - true - The ChangeNoticePerPortStatus feature is supported on the device
21904  - false - The ChangeNoticePerPortStatus feature is not supported on the device
21905  Remarks:
21906  None.
21907 */
21908 
21909 bool
21911  PORTS_MODULE_ID index ) ;
21912 //******************************************************************************
21913 /* Function:
21914  PLIB_PORTS_ExistsSlewRateControl( PORTS_MODULE_ID index )
21915  Summary:
21916  Identifies whether the SlewRateControl feature exists on the Ports module.
21917  Description:
21918  This function identifies whether the SlewRateControl feature is available
21919  on the Ports module.
21920  When this function returns true, these functions are supported on the device:
21921  - PLIB_PORTS_ChannelSlewRateSelect
21922  - PLIB_PORTS_PinSlewRateGet
21923  Preconditions:
21924  None.
21925  Parameters:
21926  index - Identifier for the device instance
21927  Returns:
21928  - true - The SlewRateControl feature is supported on the device
21929  - false - The SlewRateControl feature is not supported on the device
21930  Remarks:
21931  None.
21932 */
21933 
21934 bool
21936  PORTS_MODULE_ID index ) ;
21937 //******************************************************************************
21938 /* Function:
21939  PLIB_PORTS_ExistsChannelChangeNoticeMethod( PORTS_MODULE_ID index )
21940  Summary:
21941  Identifies whether the ChannelChangeNoticeMethod feature exists on the
21942  Ports module.
21943  Description:
21944  This function identifies whether the ChannelChangeNoticeMethod feature is
21945  available on the Ports module.
21946  When this function returns true, these functions are supported on the device:
21947  - PLIB_PORTS_ChannelChangeNoticeMethodSelect
21948  - PLIB_PORTS_ChannelChangeNoticeMethodGet
21949  Preconditions:
21950  None.
21951  Parameters:
21952  index - Identifier for the device instance
21953  Returns:
21954  - true - The ChannelChangeNoticeMethod feature is supported on the device
21955  - false - The ChannelChangeNoticeMethod feature is not supported on the device
21956  Remarks:
21957  None.
21958 */
21959 
21960 bool
21962  PORTS_MODULE_ID index ) ;
21963 //******************************************************************************
21964 /* Function:
21965  PLIB_PORTS_ExistsChangeNoticeEdgeControl( PORTS_MODULE_ID index )
21966  Summary:
21967  Identifies whether the ChangeNoticeEdgeControl feature exists on the Ports
21968  module.
21969  Description:
21970  This function identifies whether the ChangeNoticeEdgeControl feature is
21971  available on the Ports module.
21972  When this function returns true, these functions are supported on the device:
21973  - PLIB_PORTS_ChannelChangeNoticeEdgeEnable
21974  - PLIB_PORTS_ChannelChangeNoticeEdgeDisable
21975  - PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
21976  Preconditions:
21977  None.
21978  Parameters:
21979  index - Identifier for the device instance
21980  Returns:
21981  - true - The ChangeNoticeEdgeControl feature is supported on the device
21982  - false - The ChangeNoticeEdgeControl feature is not supported on the device
21983  Remarks:
21984  None.
21985 */
21986 
21987 bool
21989  PORTS_MODULE_ID index ) ;
21990 //******************************************************************************
21991 /* Function:
21992  PLIB_PORTS_ExistsChangeNoticeEdgeStatus( PORTS_MODULE_ID index )
21993  Summary:
21994  Identifies whether the ChangeNoticeEdgeStatus feature exists on the Ports
21995  module.
21996  Description:
21997  This function identifies whether the ChangeNoticeEdgeStatus feature is available
21998  on the Ports module.
21999  When this function returns true, this function is supported on the device:
22000  - PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
22001  Preconditions:
22002  None.
22003  Parameters:
22004  index - Identifier for the device instance
22005  Returns:
22006  - true - The ChangeNoticeEdgeStatus feature is supported on the device
22007  - false - The ChangeNoticeEdgeStatus feature is not supported on the device
22008  Remarks:
22009  None.
22010 */
22011 
22012 bool
22014  PORTS_MODULE_ID index ) ;
22015 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h */
22016 /*******************************************************************************
22017  Ports Peripheral Library Compatibility Header
22018  Company:
22019  Microchip Technology Inc.
22020  File Name:
22021  plib_ports_compatibility.h
22022  Summary:
22023  Ports Peripheral Library Interface header for backward compatibility.
22024  Description:
22025  This header file contains the definitions of the functions which are
22026  supported for backward compatibility only. These will be deprecated later.
22027 *******************************************************************************/
22028 // DOM-IGNORE-BEGIN
22029 /*******************************************************************************
22030 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
22031 Microchip licenses to you the right to use, modify, copy and distribute
22032 Software only when embedded on a Microchip microcontroller or digital signal
22033 controller that is integrated into your product or third party product
22034 (pursuant to the sublicense terms in the accompanying license agreement).
22035 You should refer to the license agreement accompanying this Software for
22036 additional information regarding your rights and obligations.
22037 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
22038 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
22039 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
22040 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
22041 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
22042 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
22043 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
22044 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
22045 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
22046 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
22047 *******************************************************************************/
22048 // DOM-IGNORE-END
22049 #ifndef _PLIB_PORTS_COMPATIBILITY_H
22050 #define _PLIB_PORTS_COMPATIBILITY_H
22051 #include <stdint.h>
22052 #include <stddef.h>
22053 // *****************************************************************************
22054 /* Function:
22055  bool PLIB_PORTS_ChangeNoticePerPortHasOccured ( PORTS_MODULE_ID index,
22056  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
22057  Summary:
22058  checks the status of change on the pin
22059  Description:
22060  This function checks if the change has occurred on the given pin or not.
22061  Precondition:
22062  None.
22063  Parameters:
22064  index - Identifier for the device instance to be configured
22065  channel - Port pin channel
22066  bitPos - Position in the PORT pins
22067  Returns:
22068  None.
22069  Example:
22070  <code>
22071 
22072  if(PLIB_PORTS_ChangeNoticePerPortHasOccured( PORTS_ID_0,
22073  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
22074  {
22075  //do something
22076  }
22077 
22078  </code>
22079  Remarks:
22080  This feature may not be available on all devices. Please refer to the
22081  specific device data sheet to determine availability or use
22082  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
22083  whether this feature is available.
22084 
22085  This function will be deprecated later.
22086 */
22087 #define PLIB_PORTS_ChangeNoticePerPortHasOccured PLIB_PORTS_ChangeNoticePerPortHasOccurred
22088  // #ifndef _PLIB_PORTS_COMPATIBILITY_H
22089 /*******************************************************************************
22090  End of File
22091 */
22092 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h*/
22093 /* CLOSE_FILE Include File */
22094 
22095 //DOM-IGNORE-BEGIN
22096 //DOM-IGNORE-END
22097  // #ifndef _PLIB_PORTS_H
22098 /*******************************************************************************
22099  End of File
22100 */
22101 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h*/
22102 /* CLOSE_FILE Include File */
22103 
22104 #include "system/int/sys_int.h"
22105 // *****************************************************************************
22106 // *****************************************************************************
22107 // Section: SYS PORTS Data Types
22108 // *****************************************************************************
22109 // *****************************************************************************
22110 // *****************************************************************************
22111 /* SYS PORTS PULLUP status
22112  Summary:
22113  Provides the pull-up and pull-down status.
22114  Description:
22115  These constants provide the pull-up or pull-down status definitions.
22116  Remarks:
22117  None.
22118 */
22119 
22120 typedef
22121  enum
22122  {
22123  /* PULLUP Disable */
22125  /*DOM-IGNORE-BEGIN*/
22126  = 0 /*DOM-IGNORE-END*/
22127  ,
22128  /* PULLUP Enable */
22130  /*DOM-IGNORE-BEGIN*/
22131  = 1 /*DOM-IGNORE-END*/
22132  ,
22134 // *****************************************************************************
22135 /* SYS PORTS PIN DIRECTION
22136  Summary:
22137  Defines the direction of the port pins.
22138  Description:
22139  These constants provide the port pin direction definitions.
22140  Remarks:
22141  None.
22142 */
22143 
22144 typedef
22145  enum
22146  {
22147  /* Direction as output */
22149  /*DOM-IGNORE-BEGIN*/
22150  = 0 /*DOM-IGNORE-END*/
22151  ,
22152  /* Direction as input */
22154  /*DOM-IGNORE-BEGIN*/
22155  = 1 /*DOM-IGNORE-END*/
22156  ,
22158 
22159 typedef
22160  enum
22161  {
22164  // #ifndef _SYS_PORTS_DEFINITIONS_H
22165 /*******************************************************************************
22166  End of File
22167 */
22168 
22169 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h*/
22170 /* CLOSE_FILE Include File */
22171 
22172 // DOM-IGNORE-BEGIN
22173 // DOM-IGNORE-END
22174 // *****************************************************************************
22175 // *****************************************************************************
22176 // Section: SYS PorTS Module Initialization Routine
22177 // *****************************************************************************
22178 // *****************************************************************************
22179 // *****************************************************************************
22180 /* Function:
22181  void SYS_PORTS_Initialize()
22182  Summary:
22183  Initializes PORT Pins/Channels.
22184  <p><b>Implementation:</b> Static/Dynamic</p>
22185  Description:
22186  This function initializes different port pins/channels to the desired state.
22187  It also remaps the pins to the desired specific function.
22188  Precondition:
22189  None.
22190  Parameters:
22191  None.
22192  Returns:
22193  None.
22194  Example:
22195  <code>
22196  SYS_PORTS_Initialize();
22197  </code>
22198  Remarks:
22199  This API must be be called at the time of system initialization to
22200  initialize the ports pins.
22201 */
22202 
22203 void
22205 // *****************************************************************************
22206 // *****************************************************************************
22207 // Section: SYS PORTS CONTROL Routines
22208 // *****************************************************************************
22209 // *****************************************************************************
22210 // *****************************************************************************
22211 /* Function:
22212  PORTS_DATA_TYPE SYS_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22213  Summary:
22214  Reads the data from the I/O port.
22215  <p><b>Implementation:</b> Dynamic</p>
22216  Description:
22217  This function reads the data from the I/O port.
22218  Preconditions:
22219  The direction of the port to be set as input.
22220  Parameters:
22221  index - Identifier for the device instance to be configured
22222  channel - Identifier for the PORT channel: A, B, C, etc.
22223  Returns:
22224  Returns the data read from the port.
22225  Example:
22226  <code>
22227  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22228  // application developer.
22229  PORTS_DATA_TYPE readData;
22230  readData = SYS_PORTS_Read( MY_PORTS_INSTANCE, MY_CHANNEL );
22231  </code>
22232  Remarks:
22233  None.
22234 */
22235 
22237  SYS_PORTS_Read (
22238  PORTS_MODULE_ID index ,
22239  PORTS_CHANNEL channel ) ;
22240 // *****************************************************************************
22241 /* Function:
22242  void SYS_PORTS_Write( PORTS_MODULE_ID index,
22243  PORTS_CHANNEL channel,
22244  PORTS_DATA_TYPE value )
22245  Summary:
22246  Writes the data to the I/O port.
22247  <p><b>Implementation:</b> Dynamic</p>
22248  Description:
22249  This function writes the data to the I/O port.
22250  Preconditions:
22251  The direction of the port to be set as output.
22252  Parameters:
22253  index - Identifier for the device instance to be configured
22254  channel - Identifier for the PORT channel: A, B, C, etc.
22255  value - Value to be written into a port of width PORTS_DATA_TYPE
22256  Returns:
22257  None.
22258  Example:
22259  <code>
22260  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22261  // application developer.
22262  PORTS_DATA_TYPE writeData;
22263  SYS_PORTS_Write( MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE );
22264  </code>
22265  Remarks:
22266  None.
22267 */
22268 
22269 void
22270  SYS_PORTS_Write (
22271  PORTS_MODULE_ID index ,
22272  PORTS_CHANNEL channel ,
22273  PORTS_DATA_TYPE value ) ;
22274 // *****************************************************************************
22275 /* Function:
22276  PORTS_DATA_TYPE SYS_PORTS_LatchedGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22277  Summary:
22278  Reads the data driven on the I/O port.
22279  <p><b>Implementation:</b> Dynamic</p>
22280  Description:
22281  This function reads the data driven on the I/O port.
22282  Preconditions:
22283  The direction of the port to be set as output.
22284  Parameters:
22285  index - Identifier for the device instance to be configured
22286  channel - Identifier for the PORT channel: A, B, C, etc.
22287  Returns:
22288  Returns the data driven on the port.
22289  Example:
22290  <code>
22291  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22292  // application developer.
22293  PORTS_DATA_TYPE drivenData;
22294  drivenData = SYS_PORTS_LatchedGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22295  </code>
22296  Remarks:
22297  None.
22298 */
22299 
22302  PORTS_MODULE_ID index ,
22303  PORTS_CHANNEL channel ) ;
22304 // *****************************************************************************
22305 /* Function:
22306  void SYS_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22307  PORTS_DATA_TYPE value,
22308  PORTS_DATA_MASK mask )
22309  Summary:
22310  Sets the selected digital port/latch based on the mask.
22311  <p><b>Implementation:</b> Dynamic</p>
22312  Description:
22313  This function Sets the selected digital port/latch relative to the mask.
22314  This function "AND" value and mask parameters and then set the bits
22315  in the port channel that were set in the result of the ANDing operation.
22316  Preconditions:
22317  None.
22318  Parameters:
22319  index - Identifier for the device instance to be configured
22320  channel - Identifier for the PORT channel: A, B, C, etc.
22321  value - Consists of information about which port bit has to be set
22322  mask - Identifies the bits which could be intended for setting
22323  Returns:
22324  None.
22325  Example:
22326  <code>
22327  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22328  // application developer.
22329  // MY_VALUE - 0x1234
22330  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
22331  // Set the MY_CHANNEL bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
22332  SYS_PORTS_Set(MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE, myMask);
22333  </code>
22334  Remarks:
22335  Not all features are available on all devices. Refer to the specific device
22336  data sheet for availability.
22337 */
22338 
22339 void
22340  SYS_PORTS_Set (
22341  PORTS_MODULE_ID index ,
22342  PORTS_CHANNEL channel ,
22343  PORTS_DATA_TYPE value ,
22344  PORTS_DATA_MASK mask ) ;
22345 // *****************************************************************************
22346 /* Function:
22347  void SYS_PORTS_Clear ( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22348  PORTS_DATA_MASK clearMask )
22349  Summary:
22350  Clears the selected digital port.
22351  <p><b>Implementation:</b> Dynamic</p>
22352  Description:
22353  This function clears the selected digital port.
22354  Preconditions:
22355  None.
22356  Parameters:
22357  index - Identifier for the device instance to be configured
22358  channel - Identifier for the PORT channel: A, B, C, etc.
22359  clearMask - Identifies the bits to be cleared
22360  Returns:
22361  None.
22362  Example:
22363  <code>
22364  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22365  // application developer.
22366  PORTS_DATA_MASK clearMask = (PORTS_DATA_MASK)0x00FF;
22367  SYS_PORTS_Clear( MY_PORTS_INSTANCE, MY_CHANNEL, clearMask );
22368  </code>
22369  Remarks:
22370  Not all features are available on all devices. Refer to the specific device
22371  data sheet for availability.
22372 */
22373 
22374 void
22375  SYS_PORTS_Clear (
22376  PORTS_MODULE_ID index ,
22377  PORTS_CHANNEL channel ,
22378  PORTS_DATA_MASK clearMask ) ;
22379 // *****************************************************************************
22380 /* Function:
22381  void SYS_PORTS_DirectionSelect( PORTS_MODULE_ID index,
22382  SYS_PORTS_PIN_DIRECTION pinDir,
22383  PORTS_CHANNEL channel,
22384  PORTS_DATA_MASK mask )
22385  Summary:
22386  Enables the direction for the selected port.
22387  <p><b>Implementation:</b> Dynamic</p>
22388  Description:
22389  This function enables the direction for the selected port.
22390  Preconditions:
22391  None.
22392  Parameters:
22393  index - Identifier for the device instance to be configured
22394  pinDir - Pin direction
22395  channel - Identifier for the PORT channel: A, B, C, etc.
22396  mask - Mask for the direction of width PORTS_DATA_MASK
22397  Returns:
22398  None
22399  Example:
22400  <code>
22401  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22402  // application developer.
22403  SYS_PORTS_PIN_DIRECTION pinDir;
22404  pinDir = SYS_PORTS_DIRECTION_INPUT;
22405  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
22406  SYS_PORTS_DirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, myMask );
22407  </code>
22408  Remarks:
22409  None.
22410 */
22411 
22412 void
22414  PORTS_MODULE_ID index ,
22415  SYS_PORTS_PIN_DIRECTION pinDir ,
22416  PORTS_CHANNEL channel ,
22417  PORTS_DATA_MASK mask ) ;
22418 // *****************************************************************************
22419 /* Function:
22420  PORTS_DATA_MASK SYS_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22421  Summary:
22422  Reads the direction for the selected port.
22423  <p><b>Implementation:</b> Dynamic</p>
22424  Description:
22425  This function reads the direction for the selected port.
22426  Preconditions:
22427  None.
22428  Parameters:
22429  index - Identifier for the device instance to be configured
22430  channel - Identifier for the PORT channel: A, B, C, etc.
22431  Returns:
22432  Direction of the port.
22433  Example:
22434  <code>
22435  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22436  // application developer.
22437  PORTS_DATA_MASK value;
22438  value = SYS_PORTS_DirectionGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22439  </code>
22440  Remarks:
22441  None.
22442 */
22443 
22446  PORTS_MODULE_ID index ,
22447  PORTS_CHANNEL channel ) ;
22448 // *****************************************************************************
22449 /* Function:
22450  void SYS_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22451  PORTS_DATA_MASK toggleMask )
22452  Summary:
22453  Toggles the selected digital port pins.
22454  <p><b>Implementation:</b> Dynamic</p>
22455  Description:
22456  This function toggles the selected digital port pins.
22457  Preconditions:
22458  None.
22459  Parameters:
22460  index - Identifier for the device instance to be configured
22461  channel - Identifier for the PORT channel: A, B, C, etc.
22462  toggleMask - Identifies the bits to be toggled
22463  Returns:
22464  None.
22465  Example:
22466  <code>
22467  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22468  // application developer.
22469  PORTS_DATA_MASK toggleMask = (PORTS_DATA_MASK)0x00FF;
22470  SYS_PORTS_Toggle( MY_PORTS_INSTANCE, MY_CHANNEL, toggleMask );
22471  </code>
22472  Remarks:
22473  None.
22474 */
22475 
22476 void
22478  PORTS_MODULE_ID index ,
22479  PORTS_CHANNEL channel ,
22480  PORTS_DATA_MASK toggleMask ) ;
22481 // *****************************************************************************
22482 /* Function:
22483  void SYS_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22484  PORTS_DATA_MASK mask )
22485  Summary:
22486  Enables the open-drain functionality for the selected port.
22487  <p><b>Implementation:</b> Dynamic</p>
22488  Description:
22489  This function enables the open-drain functionality for the selected port.
22490  Preconditions:
22491  None.
22492  Parameters:
22493  index - Identifier for the device instance to be configured
22494  channel - Identifier for the PORT channel: A, B, C, etc.
22495  mask - Mask of type PORTS_DATA_MASK
22496  Returns:
22497  None.
22498  Example:
22499  <code>
22500  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22501  // application developer.
22502  SYS_PORTS_OpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22503  </code>
22504  Remarks:
22505  Not all features are available on all devices. Refer to the specific device
22506  data sheet for availability.
22507 */
22508 
22509 void
22511  PORTS_MODULE_ID index ,
22512  PORTS_CHANNEL channel ,
22513  PORTS_DATA_MASK mask ) ;
22514 // *****************************************************************************
22515 /* Function:
22516  void SYS_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22517  PORTS_DATA_MASK mask )
22518  Summary:
22519  Disables the open-drain functionality for the selected port.
22520  <p><b>Implementation:</b> Dynamic</p>
22521  Description:
22522  This function disables the open-drain functionality for the selected port.
22523  Preconditions:
22524  None.
22525  Parameters:
22526  index - Identifier for the device instance to be configured
22527  channel - Identifier for the PORT channel: A, B, C, etc.
22528  mask - Mask of type PORTS_DATA_MASK
22529  Returns:
22530  None.
22531  Example:
22532  <code>
22533  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22534  // application developer.
22535  SYS_PORTS_PeripheralOpenDrainDisable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22536  </code>
22537  Remarks:
22538  Not all features are available on all devices. Refer to the specific device
22539  data sheet for availability.
22540 */
22541 
22542 void
22544  PORTS_MODULE_ID index ,
22545  PORTS_CHANNEL channel ,
22546  PORTS_DATA_MASK mask ) ;
22547 // *****************************************************************************
22548 /* Function:
22549  PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet
22550  (
22551  PORTS_MODULE_ID index,
22552  PORTS_CHANNEL channel
22553  )
22554  Summary:
22555  Reads the interrupt status from the I/O port.
22556  <p><b>Implementation:</b> Dynamic</p>
22557  Description:
22558  This function reads the interrupt status from the I/O port.
22559  Preconditions:
22560  The interrupts should have been configured.
22561  Parameters:
22562  index - Identifier for the device instance to be configured
22563  channel - Identifier for the PORT channel: A, B, C, etc.
22564  Returns:
22565  Returns the interrupt status of the port channel.
22566  Example:
22567  <code>
22568  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22569  // application developer.
22570  PORTS_DATA_TYPE channelStatus;
22571  channelStatus = SYS_PORTS_InterruptStatusGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22572  </code>
22573  Remarks:
22574  None.
22575 */
22576 
22579  PORTS_MODULE_ID index ,
22580  PORTS_CHANNEL channel ) ;
22581 // *****************************************************************************
22582 // *****************************************************************************
22583 // Section: SYS PORT PINS REMAPING Routines
22584 // *****************************************************************************
22585 // *****************************************************************************
22586 // *****************************************************************************
22587 /* Function:
22588  void SYS_PORTS_RemapInput( PORTS_MODULE_ID index,
22589  PORTS_REMAP_INPUT_FUNCTION function,
22590  PORTS_REMAP_INPUT_PIN remapPin )
22591  Summary:
22592  Input/Output (I/O) function remapping.
22593  <p><b>Implementation:</b> Dynamic</p>
22594  Description:
22595  This function controls the I/O function remapping.
22596  Precondition:
22597  None.
22598  Parameters:
22599  index - Identifier for the device instance to be configured
22600  function - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
22601  remapPin - One of the possible values of PORTS_REMAP_INPUT_PIN
22602  Returns:
22603  None.
22604  Example:
22605  <code>
22606  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22607  // application developer.
22608  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
22609  SYS_PORTS_RemapInput(MY_PORTS_INSTANCE, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
22610  </code>
22611  Remarks:
22612  This feature may not be available on all devices. Please refer to the
22613  specific device data sheet to determine availability or use
22614  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22615  this feature is available.
22616 */
22617 
22618 void
22620  PORTS_MODULE_ID index ,
22621  PORTS_REMAP_INPUT_FUNCTION function ,
22622  PORTS_REMAP_INPUT_PIN remapPin ) ;
22623 // *****************************************************************************
22624 /* Function:
22625  void SYS_PORTS_RemapOutput( PORTS_MODULE_ID index,
22626  PORTS_REMAP_OUTPUT_FUNCTION function,
22627  PORTS_REMAP_OUTPUT_PIN remapPin )
22628  Summary:
22629  Input/Output (I/O) function remapping.
22630  <p><b>Implementation:</b> Dynamic</p>
22631  Description:
22632  This function controls the I/O function remapping.
22633  Precondition:
22634  None.
22635  Parameters:
22636  index - Identifier for the device instance to be configured
22637  function - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
22638  remapPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
22639  Returns:
22640  None.
22641  Example:
22642  <code>
22643  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22644  // application developer.
22645  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
22646  SYS_PORTS_RemapInputOutput(MY_PORTS_INSTANCE, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
22647  </code>
22648  Remarks:
22649  This feature may not be available on all devices. Please refer to the
22650  specific device data sheet to determine availability or use
22651  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22652  this feature is available.
22653 */
22654 
22655 void
22657  PORTS_MODULE_ID index ,
22658  PORTS_REMAP_OUTPUT_FUNCTION function ,
22659  PORTS_REMAP_OUTPUT_PIN remapPin ) ;
22660 // *****************************************************************************
22661 // *****************************************************************************
22662 // Section: SYS Change Notification Pins Routines
22663 // *****************************************************************************
22664 // *****************************************************************************
22665 // *****************************************************************************
22666 /* Function:
22667  void SYS_PORTS_ChangeNotificationGlobalEnable( PORTS_MODULE_ID index )
22668  Summary:
22669  Globally enables the change notification for the selected port.
22670  <p><b>Implementation:</b> Dynamic</p>
22671  Description:
22672  This function globally enables the change notification for the selected port.
22673  Preconditions:
22674  None.
22675  Parameters:
22676  None.
22677  Returns:
22678  None.
22679  Example:
22680  <code>
22681  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22682  // application developer.
22683  SYS_PORTS_ChangeNotificationGlobalEnable( MY_PORTS_INSTANCE );
22684  </code>
22685  Remarks:
22686  Not all features are available on all devices. Refer to the specific device
22687  data sheet for availability.
22688 */
22689 
22690 void
22692  PORTS_MODULE_ID index ) ;
22693 // *****************************************************************************
22694 /* Function:
22695  void SYS_PORTS_ChangeNotificationGlobalDisable( PORTS_MODULE_ID index );
22696  Summary:
22697  Globally disables the change notification for the selected port.
22698  <p><b>Implementation:</b> Dynamic</p>
22699  Description:
22700  This function globally disables the change notification for the selected port.
22701  Preconditions:
22702  None.
22703  Parameters:
22704  None.
22705  Returns:
22706  None.
22707  Example:
22708  <code>
22709  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22710  // application developer.
22711  SYS_PORTS_ChangeNotificationGlobalDisable( MY_PORTS_INSTANCE);
22712  </code>
22713  Remarks:
22714  Not all features are available on all devices. Refer to the specific device
22715  data sheet for availability.
22716 */
22717 
22718 void
22720  PORTS_MODULE_ID index ) ;
22721 // *****************************************************************************
22722 /* Function:
22723  void SYS_PORTS_ChangeNotificationEnable( PORTS_MODULE_ID index,
22724  PORTS_CHANGE_NOTICE_PIN pinNum,
22725  SYS_PORTS_PULLUP_PULLDOWN_STATUS value )
22726  Summary:
22727  Enables the change notification for the selected port.
22728  <p><b>Implementation:</b> Dynamic</p>
22729  Description:
22730  This function enables the change notification for the selected port.
22731  Preconditions:
22732  None.
22733  Parameters:
22734  index - Identifier for the device instance to be configured
22735  value - Pull-up enable or disable value
22736  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22737  Returns:
22738  None.
22739  Example:
22740  <code>
22741  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22742  // application developer.
22743  SYS_PORTS_PULLUP_PULLDOWN_STATUS value;
22744  PORTS_CHANGE_NOTICE_PIN pinNum;
22745  SYS_PORTS_ChangeNotificationEnable( index, pinNum, value );
22746  </code>
22747  Remarks:
22748  Not all features are available on all devices. Refer to the specific device
22749  data sheet for availability.
22750 */
22751 
22752 void
22754  PORTS_MODULE_ID index ,
22755  PORTS_CHANGE_NOTICE_PIN pinNum ,
22757 // *****************************************************************************
22758 /* Function:
22759  void SYS_PORTS_ChangeNotificationDisable( PORTS_MODULE_ID index,
22760  PORTS_CHANGE_NOTICE_PIN pinNum )
22761  Summary:
22762  Disables the change notification for the selected port.
22763  <p><b>Implementation:</b> Dynamic</p>
22764  Description:
22765  This function disables the change notification for the selected port.
22766  Preconditions:
22767  None.
22768  Parameters:
22769  index - Identifier for the device instance to be configured
22770  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22771  Returns:
22772  None.
22773  Example:
22774  <code>
22775  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22776  // application developer.
22777  PORTS_CHANGE_NOTICE_PIN pinNum;
22778  SYS_PORTS_ChangeNotificationDisable( index, pinNum );
22779  </code>
22780  Remarks:
22781  Not all features are available on all devices. Refer to the specific device
22782  data sheet for availability.
22783 */
22784 
22785 void
22787  PORTS_MODULE_ID index ,
22788  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22789 // *****************************************************************************
22790 /* Function:
22791  void SYS_PORTS_ChangeNotificationInIdleModeEnable( PORTS_MODULE_ID index );
22792  Summary:
22793  Enables the change notification for the selected port in Sleep or Idle mode.
22794  <p><b>Implementation:</b> Dynamic</p>
22795  Description:
22796  This function enables the change notification for the selected port in Sleep
22797  or Idle mode.
22798  Preconditions:
22799  None.
22800  Parameters:
22801  None.
22802  Returns:
22803  None.
22804  Example:
22805  <code>
22806  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22807  // application developer.
22808  SYS_PORTS_ChangeNotificationInIdleModeEnable( MY_PORTS_INSTANCE );
22809  </code>
22810  Remarks:
22811  Not all features are available on all devices. Refer to the specific device
22812  data sheet for availability.
22813 */
22814 
22815 void
22817  PORTS_MODULE_ID index ) ;
22818 // *****************************************************************************
22819 /* Function:
22820  void SYS_PORTS_ChangeNotificationInIdleModeDisable( PORTS_MODULE_ID index);
22821  Summary:
22822  Disables the change notification for the selected port in Sleep or Idle mode.
22823  <p><b>Implementation:</b> Dynamic</p>
22824  Description:
22825  This function disables the change notification for the selected port in Sleep
22826  or Idle mode.
22827  Preconditions:
22828  None.
22829  Parameters:
22830  None.
22831  Returns:
22832  None.
22833  Example:
22834  <code>
22835  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22836  // application developer.
22837  SYS_PORTS_ChangeNotificationInIdleModeDisable( MY_PORTS_INSTANCE );
22838  </code>
22839  Remarks:
22840  Not all features are available on all devices. Refer to the specific device
22841  data sheet for availability.
22842 */
22843 
22844 void
22846  PORTS_MODULE_ID index ) ;
22847 // *****************************************************************************
22848 /* Function:
22849  void SYS_PORTS_ChangeNotificationPullUpEnable ( PORTS_MODULE_ID index,
22850  PORTS_CHANGE_NOTICE_PIN pinNum )
22851  Summary:
22852  Enables a weak pull-up on the change notification pin.
22853  <p><b>Implementation:</b> Dynamic</p>
22854  Description:
22855  This function enables a weak pull-up on the change notification pin.
22856  Preconditions:
22857  None.
22858  Parameters:
22859  index - Identifier for the device instance to be configured
22860  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22861  Returns:
22862  None.
22863  Example:
22864  <code>
22865  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22866  // application developer.
22867  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22868  SYS_PORTS_ChangeNotificationPullUpEnable( MY_PORTS_INSTANCE, MY_PINNUM );
22869  </code>
22870  Remarks:
22871  Not all features are available on all devices. Refer to the specific device
22872  data sheet for availability.
22873 */
22874 
22875 void
22877  PORTS_MODULE_ID index ,
22878  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22879 // *****************************************************************************
22880 /* Function:
22881  void SYS_PORTS_ChangeNotificationPullUpDisable ( PORTS_MODULE_ID index,
22882  PORTS_CHANGE_NOTICE_PIN pinNum )
22883  Summary:
22884  Disables a weak pull-up on the change notification pin.
22885  <p><b>Implementation:</b> Dynamic</p>
22886  Description:
22887  This function Disables a weak pull-up on the change notification pin.
22888  Preconditions:
22889  None.
22890  Parameters:
22891  index - Identifier for the device instance to be configured
22892  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22893  Returns:
22894  None.
22895  Example:
22896  <code>
22897  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22898  // application developer.
22899  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22900  SYS_PORTS_ChangeNotificationPullUpDisable( MY_PORTS_INSTANCE, MY_PINNUM );
22901  </code>
22902  Remarks:
22903  Not all features are available on all devices. Refer to the specific device
22904  data sheet for availability.
22905 */
22906 
22907 void
22909  PORTS_MODULE_ID index ,
22910  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22911 // *****************************************************************************
22912 // *****************************************************************************
22913 // Section: SYS PORT PINS Control Routines
22914 // *****************************************************************************
22915 // *****************************************************************************
22916 // *****************************************************************************
22917 /* Function:
22918  void SYS_PORTS_PinModeSelect ( PORTS_MODULE_ID index,
22919  PORTS_ANALOG_PIN pin,
22920  PORTS_PIN_MODE mode)
22921  Summary:
22922  Enables the selected pin as analog or digital.
22923  <p><b>Implementation:</b> Dynamic</p>
22924  Description:
22925  This function enables the selected pin as analog or digital.
22926  Preconditions:
22927  None.
22928  Parameters:
22929  index - Identifier for the device instance to be configured
22930  pin - Possible values of PORTS_ANALOG_PIN
22931  mode - Possible values of PORTS_PIN_MODE
22932  Returns:
22933  None.
22934  Example:
22935  <code>
22936  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22937  // application developer.
22938  // MY_PIN - PORTS_ANALOG_PIN_AN0
22939  // MY_PIN_MODE - PORTS_PIN_MODE_ANALOG
22940  SYS_PORTS_PinModSYS_PORTS_PinModeSelecteSelect( MY_PORTS_INSTANCE, MY_PIN, MY_PIN_MODE );
22941  </code>
22942  Remarks:
22943  Not all features are available on all devices. Refer to the specific device
22944  data sheet for availability.
22945 */
22946 
22947 void
22949  PORTS_MODULE_ID index ,
22950  PORTS_ANALOG_PIN pin ,
22951  PORTS_PIN_MODE mode ) ;
22952 // *****************************************************************************
22953 /* Function:
22954  void SYS_PORTS_PinWrite ( PORTS_MODULE_ID index,
22955  PORTS_CHANNEL channel,
22956  PORTS_BIT_POS bitPos
22957  bool value )
22958  Summary:
22959  Writes the selected digital pin.
22960  <p><b>Implementation:</b> Dynamic</p>
22961  Description:
22962  This function writes the selected digital pin.
22963  Preconditions:
22964  None.
22965  Parameters:
22966  index - Identifier for the device instance to be configured
22967  channel - Identifier for the PORT channel: A, B, C, etc.
22968  bitPos - Possible values of PORTS_BIT_POS
22969  value - Value to be written to the specific pin/latch:
22970  - true - Sets the bit
22971  - false - Clears the bit
22972  Returns:
22973  None.
22974  Example:
22975  <code>
22976  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22977  // application developer.
22978  // MY_PINNUM - PORTS_PIN_10
22979  SYS_PORTS_PinWrite(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM, value);
22980  </code>
22981  Remarks:
22982  Not all features are available on all devices. Refer to the specific device
22983  data sheet for availability.
22984 */
22985 
22986 void
22988  PORTS_MODULE_ID index ,
22989  PORTS_CHANNEL channel ,
22990  PORTS_BIT_POS bitPos ,
22991  bool value ) ;
22992 // *****************************************************************************
22993 /* Function:
22994  bool SYS_PORTS_PinLatchedGet ( PORTS_MODULE_ID index,
22995  PORTS_CHANNEL channel,
22996  PORTS_BIT_POS bitPos )
22997  Summary:
22998  Reads the data driven on the selected digital pin.
22999  <p><b>Implementation:</b> Dynamic</p>
23000  Description:
23001  This function reads the data driven on the selected
23002  digital output pin.
23003  Preconditions:
23004  None.
23005  Parameters:
23006  index - Identifier for the device instance to be configured
23007  channel - Identifier for the PORT channel: A, B, C, etc.
23008  bitPos - Possible values of PORTS_BIT_POS
23009  Returns:
23010  The status of the data driven on the port pin.
23011  Example:
23012  <code>
23013  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23014  // application developer.
23015  // MY_PINNUM - PORTS_PIN_10
23016  status = SYS_PORTS_PinLatchedGet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
23017  </code>
23018  Remarks:
23019  Not all features are available on all devices. Refer to the specific device
23020  data sheet for availability.
23021 */
23022 
23023 bool
23025  PORTS_MODULE_ID index ,
23026  PORTS_CHANNEL channel ,
23027  PORTS_BIT_POS bitPos ) ;
23028 // *****************************************************************************
23029 /* Function:
23030  bool SYS_PORTS_PinRead ( PORTS_MODULE_ID index,
23031  PORTS_CHANNEL channel,
23032  PORTS_BIT_POS bitPos )
23033  Summary:
23034  Reads the selected digital pin.
23035  <p><b>Implementation:</b> Dynamic</p>
23036  Description:
23037  This function reads the selected digital pin, not the Latch.
23038  Preconditions:
23039  None.
23040  Parameters:
23041  index - Identifier for the device instance to be configured
23042  channel - Identifier for the PORT channel: A, B, C, etc.
23043  bitPos - Possible values of PORTS_BIT_POS
23044  Returns:
23045  The status of the port pin.
23046  Example:
23047  <code>
23048  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23049  // application developer.
23050  // MY_PINNUM - PORTS_PIN_10
23051  bool bitStatus = SYS_PORTS_PinRead(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
23052  </code>
23053  Remarks:
23054  Not all features are available on all devices. Refer to the specific device
23055  data sheet for availability.
23056 */
23057 
23058 bool
23060  PORTS_MODULE_ID index ,
23061  PORTS_CHANNEL channel ,
23062  PORTS_BIT_POS bitPos ) ;
23063 // *****************************************************************************
23064 /* Function:
23065  void SYS_PORTS_PinToggle ( PORTS_MODULE_ID index,
23066  PORTS_CHANNEL channel,
23067  PORTS_BIT_POS bitPos )
23068  Summary:
23069  Toggles the selected digital pin.
23070  <p><b>Implementation:</b> Dynamic</p>
23071  Description:
23072  This function toggles the selected digital pin.
23073  Preconditions:
23074  None.
23075  Parameters:
23076  index - Identifier for the device instance to be configured
23077  channel - Identifier for the PORT channel: A, B, C, etc.
23078  bitPos - Possible values of PORTS_BIT_POS
23079  Returns:
23080  None.
23081  Example:
23082  <code>
23083  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23084  // application developer.
23085  // MY_PINNUM - PORTS_PIN_10
23086  SYS_PORTS_PinToggle( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23087  </code>
23088  Remarks:
23089  Not all features are available on all devices. Refer to the specific device
23090  data sheet for availability.
23091 */
23092 
23093 void
23095  PORTS_MODULE_ID index ,
23096  PORTS_CHANNEL channel ,
23097  PORTS_BIT_POS bitPos ) ;
23098 // *****************************************************************************
23099 /* Function:
23100  void SYS_PORTS_PinSet( PORTS_MODULE_ID index,
23101  PORTS_CHANNEL channel,
23102  PORTS_BIT_POS bitPos )
23103  Summary:
23104  Sets the selected digital pin/latch.
23105  <p><b>Implementation:</b> Dynamic</p>
23106  Description:
23107  This function sets the selected digital pin/latch.
23108  Preconditions:
23109  None.
23110  Parameters:
23111  index - Identifier for the device instance to be configured
23112  channel - Identifier for the PORT channel: A, B, C, etc.
23113  bitPos - Possible values of PORTS_BIT_POS
23114  Returns:
23115  None.
23116  Example:
23117  <code>
23118  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23119  // application developer.
23120  // MY_PINNUM - PORTS_PIN_10
23121  SYS_PORTS_PinSet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
23122  </code>
23123  Remarks:
23124  Not all features are available on all devices. Refer to the specific device
23125  data sheet for availability.
23126 */
23127 
23128 void
23130  PORTS_MODULE_ID index ,
23131  PORTS_CHANNEL channel ,
23132  PORTS_BIT_POS bitPos ) ;
23133 // *****************************************************************************
23134 /* Function:
23135  void SYS_PORTS_PinClear ( PORTS_MODULE_ID index,
23136  PORTS_CHANNEL channel,
23137  PORTS_BIT_POS bitPos )
23138  Summary:
23139  Clears the selected digital pin.
23140  <p><b>Implementation:</b> Dynamic</p>
23141  Description:
23142  This function clears the selected digital pin.
23143  Preconditions:
23144  None.
23145  Parameters:
23146  index - Identifier for the device instance to be configured
23147  channel - Identifier for the PORT channel: A, B, C, etc.
23148  bitPos - Possible values of PORTS_BIT_POS
23149  Returns:
23150  None.
23151  Example:
23152  <code>
23153  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23154  // application developer.
23155  // MY_PINNUM - PORTS_IO_PIN_10
23156  SYS_PORTS_PinClear( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23157  </code>
23158  Remarks:
23159  Not all features are available on all devices. Refer to the specific device
23160  data sheet for availability.
23161 */
23162 
23163 void
23165  PORTS_MODULE_ID index ,
23166  PORTS_CHANNEL channel ,
23167  PORTS_BIT_POS bitPos ) ;
23168 // *****************************************************************************
23169 /* Function:
23170  void SYS_PORTS_PinDirectionSelect ( PORTS_MODULE_ID index,
23171  SYS_PORTS_PIN_DIRECTION pinDir,
23172  PORTS_CHANNEL channel,
23173  PORTS_BIT_POS bitPos )
23174  Summary:
23175  Enables the direction for the selected pin.
23176  <p><b>Implementation:</b> Dynamic</p>
23177  Description:
23178  This function enables the direction for the selected pin.
23179  Preconditions:
23180  None.
23181  Parameters:
23182  index - Identifier for the device instance to be configured
23183  pinDir - Pin direction
23184  channel - Identifier for the PORT channel: A, B, C, etc.
23185  bitPos - Possible values of PORTS_BIT_POS
23186  Returns:
23187  None.
23188  Example:
23189  <code>
23190  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23191  // application developer.
23192  // MY_PINNUM - PORTS_PIN_10
23193  SYS_PORTS_PIN_DIRECTION pinDir;
23194  pinDir = SYS_PORTS_DIRECTION_INPUT;
23195  SYS_PORTS_PinDirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, MY_PINNUM);
23196  </code>
23197  Remarks:
23198  Not all features are available on all devices. Refer to the specific device
23199  data sheet for availability.
23200 */
23201 
23202 void
23204  PORTS_MODULE_ID index ,
23205  SYS_PORTS_PIN_DIRECTION pinDir ,
23206  PORTS_CHANNEL channel ,
23207  PORTS_BIT_POS bitPos ) ;
23208 // *****************************************************************************
23209 /* Function:
23210  void SYS_PORTS_PinOpenDrainEnable ( PORTS_MODULE_ID index,
23211  PORTS_CHANNEL channel,
23212  PORTS_BIT_POS bitPos )
23213  Summary:
23214  Enables the open-drain functionality for the selected pin.
23215  <p><b>Implementation:</b> Dynamic</p>
23216  Description:
23217  This function enables the open-drain functionality for the selected pin.
23218  Preconditions:
23219  None.
23220  Parameters:
23221  index - Identifier for the device instance to be configured
23222  channel - Identifier for the PORT channel: A, B, C, etc.
23223  bitPos - Possible values of PORTS_BIT_POS
23224  Returns:
23225  None.
23226  Example:
23227  <code>
23228  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23229  // application developer.
23230  // MY_PINNUM - PORTS_PIN_10
23231  SYS_PORTS_PinOpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23232  </code>
23233  Remarks:
23234  Not all features are available on all devices. Refer to the specific device
23235  data sheet for availability.
23236 */
23237 
23238 void
23240  PORTS_MODULE_ID index ,
23241  PORTS_CHANNEL channel ,
23242  PORTS_BIT_POS bitPos ) ;
23243 // *****************************************************************************
23244 /* Function:
23245  void SYS_PORTS_PinOpenDrainDisable ( PORTS_MODULE_ID index,
23246  PORTS_CHANNEL channel,
23247  PORTS_BIT_POS bitPos )
23248  Summary:
23249  Disables the open-drain functionality for the selected pin.
23250  <p><b>Implementation:</b> Dynamic</p>
23251  Description:
23252  This function disables the open-drain functionality for the selected pin.
23253  Preconditions:
23254  None.
23255  Parameters:
23256  index - Identifier for the device instance to be configured
23257  channel - Identifier for the PORT channel: A, B, C, etc.
23258  bitPos - Possible values of PORTS_BIT_POS
23259  Returns:
23260  None.
23261  Example:
23262  <code>
23263  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23264  // application developer.
23265  // MY_PINNUM - PORTS_PIN_10
23266  SYS_PORTS_PinOpenDrainDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23267  </code>
23268  Remarks:
23269  Not all features are available on all devices. Refer to the specific device
23270  data sheet for availability.
23271 */
23272 
23273 void
23275  PORTS_MODULE_ID index ,
23276  PORTS_CHANNEL channel ,
23277  PORTS_BIT_POS bitPos ) ;
23278 // *****************************************************************************
23279 /* Function:
23280  void SYS_PORTS_PinPullUpEnable ( PORTS_MODULE_ID index,
23281  PORTS_CHANNEL channel,
23282  PORTS_BIT_POS bitPos )
23283  Summary:
23284  Enables the pull-up functionality for the selected pin.
23285  <p><b>Implementation:</b> Dynamic</p>
23286  Description:
23287  This function enables the pull-up functionality for the selected pin.
23288  Preconditions:
23289  None.
23290  Parameters:
23291  index - Identifier for the device instance to be configured
23292  channel - Identifier for the PORT channel: A, B, C, etc.
23293  bitPos - Possible values of PORTS_BIT_POS
23294  Returns:
23295  None.
23296  Example:
23297  <code>
23298  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23299  // application developer.
23300  // MY_PINNUM - PORTS_PIN_10
23301  SYS_PORTS_PinPullUpEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23302  </code>
23303  Remarks:
23304  Not all features are available on all devices. Refer to the specific device
23305  data sheet for availability.
23306 */
23307 
23308 void
23310  PORTS_MODULE_ID index ,
23311  PORTS_CHANNEL channel ,
23312  PORTS_BIT_POS bitPos ) ;
23313 // *****************************************************************************
23314 /* Function:
23315  void SYS_PORTS_PinPullUpDisable ( PORTS_MODULE_ID index,
23316  PORTS_CHANNEL channel,
23317  PORTS_BIT_POS bitPos )
23318  Summary:
23319  Disables the pull-up functionality for the selected pin.
23320  <p><b>Implementation:</b> Dynamic</p>
23321  Description:
23322  This function disables the pull-up functionality for the selected pin.
23323  Preconditions:
23324  None.
23325  Parameters:
23326  index - Identifier for the device instance to be configured
23327  channel - Identifier for the PORT channel: A, B, C, etc.
23328  bitPos - Possible values of PORTS_BIT_POS
23329  Returns:
23330  None.
23331  Example:
23332  <code>
23333  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23334  // application developer.
23335  // MY_PINNUM - PORTS_PIN_10
23336  SYS_PORTS_PinPullUpDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23337  </code>
23338  Remarks:
23339  Not all features are available on all devices. Refer to the specific device
23340  data sheet for availability.
23341 */
23342 
23343 void
23345  PORTS_MODULE_ID index ,
23346  PORTS_CHANNEL channel ,
23347  PORTS_BIT_POS bitPos ) ;
23348 // *****************************************************************************
23349 /* Function:
23350  void SYS_PORTS_PinPullDownEnable ( PORTS_MODULE_ID index,
23351  PORTS_CHANNEL channel,
23352  PORTS_BIT_POS bitPos )
23353  Summary:
23354  Enables the pull-down functionality for the selected pin.
23355  <p><b>Implementation:</b> Dynamic</p>
23356  Description:
23357  This function enables the pull-down functionality for the selected pin.
23358  Preconditions:
23359  None.
23360  Parameters:
23361  index - Identifier for the device instance to be configured
23362  channel - Identifier for the PORT channel: A, B, C, etc.
23363  bitPos - Possible values of PORTS_BIT_POS
23364  Returns:
23365  None.
23366  Example:
23367  <code>
23368  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23369  // application developer.
23370  // MY_PINNUM - PORTS_PIN_10
23371  SYS_PORTS_PinPullDownEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23372  </code>
23373  Remarks:
23374  Not all features are available on all devices. Refer to the specific device
23375  data sheet for availability.
23376 */
23377 
23378 void
23380  PORTS_MODULE_ID index ,
23381  PORTS_CHANNEL channel ,
23382  PORTS_BIT_POS bitPos ) ;
23383 // *****************************************************************************
23384 /* Function:
23385  void SYS_PORTS_PinPullDownDisable ( PORTS_MODULE_ID index,
23386  PORTS_CHANNEL channel,
23387  PORTS_BIT_POS bitPos )
23388  Summary:
23389  Disables the pull-down functionality for the selected pin.
23390  <p><b>Implementation:</b> Dynamic</p>
23391  Description:
23392  This function disables the pull-down functionality for the selected pin.
23393  Preconditions:
23394  None.
23395  Parameters:
23396  index - Identifier for the device instance to be configured
23397  channel - Identifier for the PORT channel: A, B, C, etc.
23398  bitPos - Possible values of PORTS_BIT_POS
23399  Returns:
23400  None.
23401  Example:
23402  <code>
23403  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23404  // application developer.
23405  // MY_PINNUM - PORTS_PIN_10
23406  SYS_PORTS_PinPullDownDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23407  </code>
23408  Remarks:
23409  Not all features are available on all devices. Refer to the specific device
23410  data sheet for availability.
23411 */
23412 
23413 void
23415  PORTS_MODULE_ID index ,
23416  PORTS_CHANNEL channel ,
23417  PORTS_BIT_POS bitPos ) ;
23418 //******************************************************************************
23419 /* Function:
23420  void SYS_PORTS_InterruptEnable
23421  (
23422  PORTS_MODULE_ID index,
23423  PORTS_CHANNEL channel,
23424  PORTS_BIT_POS bitPos,
23425  PORTS_PIN_INTERRUPT_TYPE pinInterruptType
23426  )
23427  Summary:
23428  Enables the selected interrupt for the selected port pin.
23429  Description:
23430  This function enables the selected interrupt for the selected port pin.
23431  Preconditions:
23432  Select the pull-up or pull-down as required.
23433  Parameters:
23434  index - Identifier for the device instance to be configured
23435  channel - Identifier for the PORT channel: A, B, C, etc.
23436  bitPos - Possible values of PORTS_BIT_POS
23437  pinInterruptType - Interrupt type from PORTS_PIN_INTERRUPT_TYPE set
23438  Returns:
23439  None.
23440  Example:
23441  <code>
23442  SYS_PORTS_InterruptEnable(MY_PORTS_INSTANCE, MY_PORTS_CHANNEL, MY_PORT_BIT_POS, PORTS_PIN_INTERRUPT_BOTH_EDGE );
23443  </code>
23444  Remarks:
23445  None.
23446 */
23447 
23448 void
23450  PORTS_MODULE_ID index ,
23451  PORTS_CHANNEL channel ,
23452  PORTS_BIT_POS bitPos ,
23453  PORTS_PIN_INTERRUPT_TYPE pinInterruptType ) ;
23454 //DOM-IGNORE-BEGIN
23455 //DOM-IGNORE-END
23456  //SYS_PORTS_H
23457 /*******************************************************************************
23458  End of File
23459 */
23460 
23461 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h*/
23462 /* CLOSE_FILE Include File */
23463 
23464 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h */
23465 /*******************************************************************************
23466  SPI Driver Interface
23467  Company:
23468  Microchip Technology Inc.
23469  File Name:
23470  drv_spi.h
23471  Summary:
23472  SPI device driver interface file.
23473  Description:
23474  The SPI driver provides a simple interface to manage the SPI module.
23475  This file defines the interface definitions and prototypes for the SPI driver.
23476 *******************************************************************************/
23477 //DOM-IGNORE-BEGIN
23478 /*******************************************************************************
23479 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
23480 Microchip licenses to you the right to use, modify, copy and distribute
23481 Software only when embedded on a Microchip microcontroller or digital signal
23482 controller that is integrated into your product or third party product
23483 (pursuant to the sublicense terms in the accompanying license agreement).
23484 You should refer to the license agreement accompanying this Software for
23485 additional information regarding your rights and obligations.
23486 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23487 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23488 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23489 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23490 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23491 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23492 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23493 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23494 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23495 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23496 *******************************************************************************/
23497 //DOM-IGNORE-END
23498 #ifndef _DRV_SPI_H
23499 #define _DRV_SPI_H
23500 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h */
23501 /*******************************************************************************
23502  SPI Driver Interface
23503  Company:
23504  Microchip Technology Inc.
23505  File Name:
23506  drv_spi_definitions.h
23507  Summary:
23508  SPI device driver interface file.
23509  Description:
23510  The SPI driver provides a simple interface to manage the SPI module.
23511  This file defines the interface definitions and prototypes for the SPI
23512  driver.
23513 *******************************************************************************/
23514 //DOM-IGNORE-BEGIN
23515 /*******************************************************************************
23516 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
23517 Microchip licenses to you the right to use, modify, copy and distribute
23518 Software only when embedded on a Microchip microcontroller or digital signal
23519 controller that is integrated into your product or third party product
23520 (pursuant to the sublicense terms in the accompanying license agreement).
23521 You should refer to the license agreement accompanying this Software for
23522 additional information regarding your rights and obligations.
23523 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23524 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23525 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23526 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23527 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23528 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23529 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23530 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23531 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23532 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23533 *******************************************************************************/
23534 //DOM-IGNORE-END
23535 #ifndef _DRV_SPI_DEFINITIONS_H
23536 #define _DRV_SPI_DEFINITIONS_H
23537 // *****************************************************************************
23538 // *****************************************************************************
23539 // Section: Data Types
23540 // *****************************************************************************
23541 // *****************************************************************************
23542 #include <stdint.h>
23543 #include <stdbool.h>
23544 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
23545 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" // Common Driver Definitions /* LDRA full path */
23546 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h */
23547 /*******************************************************************************
23548  SPI Peripheral Library Interface Header
23549  Company:
23550  Microchip Technology Inc.
23551  File Name:
23552  plib_spi.h
23553  Summary:
23554  SPI Peripheral Library Interface Header for common definitions.
23555  Description:
23556  This header file contains the function prototypes and definitions of
23557  the data types and constants that make up the interface to the SPI
23558  PLIB.
23559  *******************************************************************************/
23560 // DOM-IGNORE-BEGIN
23561 /*******************************************************************************
23562 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
23563 Microchip licenses to you the right to use, modify, copy and distribute
23564 Software only when embedded on a Microchip microcontroller or digital signal
23565 controller that is integrated into your product or third party product
23566 (pursuant to the sublicense terms in the accompanying license agreement).
23567 You should refer to the license agreement accompanying this Software for
23568 additional information regarding your rights and obligations.
23569 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23570 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23571 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23572 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23573 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23574 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23575 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23576 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23577 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23578 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23579  *******************************************************************************/
23580 // DOM-IGNORE-END
23581 #ifndef _PLIB_SPI_H
23582 #define _PLIB_SPI_H
23583 // DOM-IGNORE-BEGIN
23584 // DOM-IGNORE-END
23585 // *****************************************************************************
23586 // *****************************************************************************
23587 // Section: Included Files (continued at end of file)
23588 // *****************************************************************************
23589 // *****************************************************************************
23590 /* This section lists the other files that are included in this file. However,
23591  please see the end of the file for additional implementation header files
23592  that are also included.
23593  */
23594 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h */
23595 //DOM-IGNORE-BEGIN
23596 /*******************************************************************************
23597 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
23598 Microchip licenses to you the right to use, modify, copy and distribute
23599 Software only when embedded on a Microchip microcontroller or digital signal
23600 controller that is integrated into your product or third party product
23601 (pursuant to the sublicense terms in the accompanying license agreement).
23602 You should refer to the license agreement accompanying this Software for
23603 additional information regarding your rights and obligations.
23604 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
23605 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23606 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23607 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23608 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23609 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23610 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23611 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23612 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23613 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23614  *******************************************************************************/
23615 //DOM-IGNORE-END
23616 #ifndef _PLIB_SPI_PROCESSOR_H
23617 #define _PLIB_SPI_PROCESSOR_H
23618 #error "Can't find header"
23619 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h*/
23620 /* CLOSE_FILE Include File */
23621 
23622 // *****************************************************************************
23623 // *****************************************************************************
23624 // Section: Constants & Data Types
23625 // *****************************************************************************
23626 // *****************************************************************************
23627 // *****************************************************************************
23628 // *****************************************************************************
23629 // Section: SPI Peripheral Library Interface Routines
23630 // *****************************************************************************
23631 // *****************************************************************************
23632 //******************************************************************************
23633 /* Function:
23634  void PLIB_SPI_Enable( SPI_MODULE_ID index )
23635  Summary:
23636  Enables the SPI module.
23637  Description:
23638  This function enables the SPI module.
23639  This operation is atomic.
23640  Precondition:
23641  None.
23642  Parameters:
23643  index - Identifier for the device instance to be configured
23644  Returns:
23645  None.
23646  Example:
23647  <code>
23648  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23649  // application developer.
23650  PLIB_SPI_Enable(MY_SPI_INSTANCE);
23651  </code>
23652  Remarks:
23653  The SCKx, SDOx, SDIx and SSx pins must be assigned to available RPn pins
23654  before use.
23655  This function implements an operation of the enable control feature. This
23656  feature may not be available on all devices. Please refer to the specific
23657  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23658  in your application to automatically determine whether this feature is available.
23659  */
23660 
23661 void
23662  PLIB_SPI_Enable (
23663  SPI_MODULE_ID index ) ;
23664 //******************************************************************************
23665 /* Function:
23666  void PLIB_SPI_Disable (SPI_MODULE_ID index)
23667  Summary:
23668  Disables the SPI module.
23669  Description:
23670  This function disables the SPI module.
23671  This operation is atomic.
23672  Precondition:
23673  None.
23674  Parameters:
23675  index - Identifier for the device instance to be configured
23676  Returns:
23677  None.
23678  Example:
23679  <code>
23680  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23681  // application developer.
23682  PLIB_SPI_Disable(MY_SPI_INSTANCE);
23683  </code>
23684  Remarks:
23685  This function implements an operation of the enable control feature. This
23686  feature may not be available on all devices. Please refer to the specific
23687  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23688  in your application to automatically determine whether this feature is available.
23689  */
23690 
23691 void
23693  SPI_MODULE_ID index ) ;
23694 //******************************************************************************
23695 /* Function:
23696  void PLIB_SPI_StopInIdleEnable (SPI_MODULE_ID index)
23697  Summary:
23698  Discontinues module operation when the device enters Idle mode.
23699  Description:
23700  This function sets up the SPI module such that module operation is disabled
23701  when the device enters Idle mode.
23702  This operation is atomic.
23703  Precondition:
23704  None.
23705  Parameters:
23706  index - Identifier for the device instance to be configured
23707  Returns:
23708  None.
23709  Example:
23710  <code>
23711  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23712  // application developer.
23713  PLIB_SPI_StopInIdleEnable(MY_SPI_INSTANCE);
23714  </code>
23715  Remarks:
23716  This function implements an operation of the stop in idle control feature.
23717  This feature may not be available on all devices. Please refer to the
23718  specific device data sheet to determine availability or use
23719  "PLIB_SPI_ExistsStopInIdleControl" in your application to automatically
23720  determine if this feature is available.
23721  */
23722 
23723 void
23725  SPI_MODULE_ID index ) ;
23726 //******************************************************************************
23727 /* Function:
23728  void PLIB_SPI_StopInIdleDisable (SPI_MODULE_ID index)
23729  Summary:
23730  Continues module operation when the device enters Idle mode.
23731  Description:
23732  This function sets up the SPI module such that module operation is continued
23733  when the device enters Idle mode.
23734  This operation is atomic.
23735  Precondition:
23736  None.
23737  Parameters:
23738  index - Identifier for the device instance to be configured
23739  Returns:
23740  None.
23741  Example:
23742  <code>
23743  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23744  // application developer.
23745  PLIB_SPI_StopInIdleDisable(MY_SPI_INSTANCE);
23746  </code>
23747  Remarks:
23748  This function implements an operation of the stop in idle control feature.
23749  This feature may not be available on all devices. Please refer to the
23750  specific device data sheet to determine availability or use
23751  "PLIB_SPI_ExistsStopInIdleControl" in your application to determine whether
23752  this feature is available.
23753  */
23754 
23755 void
23757  SPI_MODULE_ID index ) ;
23758 //******************************************************************************
23759 /* Function:
23760  bool PLIB_SPI_ReceiverHasOverflowed (SPI_MODULE_ID index)
23761  Summary:
23762  Returns the current status of the SPI receiver overflow.
23763  Description:
23764  This function returns the current status of the SPI receiver overflow.
23765  This operation is atomic.
23766  Precondition:
23767  None.
23768  Parameters:
23769  index - Identifier for the device instance to be configured
23770  Returns:
23771  SPI receiver overflow status:
23772  - true - A new byte/word is completely received and discarded.
23773  The user software has not read the previous data in
23774  the SPI buffer register.
23775  - false - No Overflow has occurred
23776  Example:
23777  <code>
23778  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23779  // application developer.
23780  bool overflowstate = PLIB_SPI_ReceiverHasOverflowed(MY_SPI_INSTANCE);
23781  </code>
23782  Remarks:
23783  This function implements an operation of the receiver overflow status feature.
23784  This feature may not be available on all devices. Please refer to the
23785  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23786  in your application to automatically determine whether this feature is available.
23787  */
23788 
23789 bool
23791  SPI_MODULE_ID index ) ;
23792 //******************************************************************************
23793 /* Function:
23794  void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
23795  Summary:
23796  Clears the SPI receive overflow flag.
23797  Description:
23798  This function clears the SPI receive overflow flag.
23799  This operation is atomic.
23800  Precondition:
23801  None.
23802  Parameters:
23803  index - Identifier for the device instance to be configured
23804  Returns:
23805  None.
23806  Example:
23807  <code>
23808  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23809  // application developer.
23810  PLIB_SPI_ReceiverOverflowClear(MY_SPI_INSTANCE);
23811  </code>
23812  Remarks:
23813  This function implements an operation of the receiver overflow status feature.
23814  This feature may not be available on all devices. Please refer to the
23815  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23816  in your application to automatically determine whether this feature is available.
23817  */
23818 
23819 void
23821  SPI_MODULE_ID index ) ;
23822 //******************************************************************************
23823 /* Function:
23824  bool PLIB_SPI_TransmitBufferIsFull (SPI_MODULE_ID index)
23825  Summary:
23826  Returns the current transmit buffer status of the SPI module.
23827  Description:
23828  This function returns the current transmit buffer status of the SPI module.
23829  This operation is atomic.
23830  Precondition:
23831  None.
23832  Parameters:
23833  index - Identifier for the device instance to be configured
23834  Returns:
23835  - true - Transmit not yet started, transmit buffer is full
23836  - false - Transmit started, transmit buffer is empty/not full
23837  Example:
23838  <code>
23839  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23840  // application developer.
23841  bool buffullstate = PLIB_SPI_TransmitBufferIsFull (MY_SPI_INSTANCE);
23842  </code>
23843  Remarks:
23844  In Standard Buffer mode - automatically set in hardware when SPI buffer writes
23845  occur, loading the transmit buffer. Automatically cleared in hardware when
23846  the SPI module transfers data from the transmit buffer to the shift register.
23847  In Enhanced Buffer mode - automatically set in hardware when SPI buffer writes
23848  occur, loading the last available buffer. Automatically cleared in hardware
23849  when the buffer is available for writing.
23850  This function implements an operation of the transmit buffer status feature.
23851  This feature may not be available on all devices. Please refer to the
23852  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferFullStatus"
23853  in your application to automatically determine whether this feature is available.
23854  */
23855 
23856 bool
23858  SPI_MODULE_ID index ) ;
23859 //******************************************************************************
23860 /* Function:
23861  bool PLIB_SPI_ReceiverBufferIsFull (SPI_MODULE_ID index)
23862  Summary:
23863  Returns the current status of the SPI receive buffer.
23864  Description:
23865  This function returns the current status of the SPI receive buffer.
23866  This operation is atomic.
23867  Precondition:
23868  None.
23869  Parameters:
23870  index - Identifier for the device instance to be configured
23871  Returns:
23872  Receiver Buffer Full Status:
23873  - true - Receive complete, receive buffer is full
23874  - false - Receive is not complete, receive buffer is empty
23875  Example:
23876  <code>
23877  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23878  // application developer.
23879  bool receivefullstate = PLIB_SPI_ReceiverBufferIsFull (MY_SPI_INSTANCE);
23880  </code>
23881  Remarks:
23882  In Standard Buffer mode - automatically set in hardware when the SPI module
23883  transfers data from the shift register to the receive buffer. Automatically
23884  cleared in hardware when the core reads the SPI buffer, read in the receive buffer.
23885  In Enhanced Buffer mode - automatically set in hardware when the SPI module
23886  transfers data from the shift register to the receive buffer, filling the
23887  last unread buffer. Automatically cleared in hardware when a buffer is available
23888  for a transfer from the shift register.
23889  This function implements an operation of the receiver buffer status feature.
23890  This feature may not be available on all devices. Please refer to the
23891  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveBufferStatus"
23892  in your application to automatically determine whether this feature is available.
23893  */
23894 
23895 bool
23897  SPI_MODULE_ID index ) ;
23898 //******************************************************************************
23899 /* Function:
23900  void PLIB_SPI_PinEnable (SPI_MODULE_ID index,SPI_PIN pin)
23901  Summary:
23902  Enables the selected SPI pins.
23903  Description:
23904  This function enables the selected SPI pins.
23905  Precondition:
23906  None.
23907  Parameters:
23908  index - Identifier for the device instance to be configured
23909  pin - One of the SPI_PIN enumeration values as the SPI pin
23910  Returns:
23911  None.
23912  Example:
23913  <code>
23914  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23915  // application developer.
23916  PLIB_SPI_PinEnable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23917  </code>
23918  Remarks:
23919  This function implements an operation of the pin control feature.
23920  This feature may not be available on all devices. Please refer to the
23921  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23922  in your application to automatically determine whether this feature is available.
23923  */
23924 
23925 void
23927  SPI_MODULE_ID index ,
23928  SPI_PIN pin ) ;
23929 //******************************************************************************
23930 /* Function:
23931  void PLIB_SPI_PinDisable (SPI_MODULE_ID index, SPI_PIN pin)
23932  Summary:
23933  Enables the selected SPI pins.
23934  Description:
23935  This function enables the selected SPI pins.
23936  Precondition:
23937  None.
23938  Parameters:
23939  index - Identifier for the device instance to be configured
23940  pin - One of the SPI_PIN enumeration values as the SPI pin
23941  Returns:
23942  None.
23943  Example:
23944  <code>
23945  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23946  // application developer.
23947  PLIB_SPI_PinDisable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23948  </code>
23949  Remarks:
23950  This function implements an operation of the pin control feature.
23951  This feature may not be available on all devices. Please refer to the
23952  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23953  in your application to automatically determine whether this feature is available.
23954  */
23955 
23956 void
23958  SPI_MODULE_ID index ,
23959  SPI_PIN pin ) ;
23960 //******************************************************************************
23961 /* Function:
23962  void PLIB_SPI_CommunicationWidthSelect (SPI_MODULE_ID index,
23963  SPI_COMMUNICATION_WIDTH width )
23964  Summary:
23965  Selects the data width for the SPI communication.
23966  Description:
23967  This function selects the data width for the SPI communication.
23968  This operation is atomic.
23969  Precondition:
23970  None.
23971  Parameters:
23972  index - Identifier for the device instance to be configured
23973  width - One of the SPI_COMMUNICATION_WIDTH enumeration values as the
23974  SPI buffer width
23975  Returns:
23976  None.
23977  Example:
23978  <code>
23979  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23980  // application developer.
23981  PLIB_SPI_CommunicationWidthSelect(MY_SPI_INSTANCE, SPI_COMMUNICATION_WIDTH_8BITS);
23982  </code>
23983  Remarks:
23984  This function implements an operation of the communication width feature.
23985  This feature may not be available on all devices. Please refer to the
23986  specific device data sheet to determine availability or use "PLIB_SPI_ExistsCommunicationWidth"
23987  in your application to automatically determine whether this feature is available.
23988  */
23989 
23990 void
23992  SPI_MODULE_ID index ,
23993  SPI_COMMUNICATION_WIDTH width ) ;
23994 //******************************************************************************
23995 /* Function:
23996  void PLIB_SPI_AudioCommunicationWidthSelect (SPI_MODULE_ID index,
23997  SPI_AUDIO_COMMUNICATION_WIDTH width )
23998  Summary:
23999  Selects the data width for the SPI audio communication.
24000  Description:
24001  This function selects the data width for the SPI audio communication.
24002  This operation is atomic.
24003  Precondition:
24004  None.
24005  Parameters:
24006  index - Identifier for the device instance to be configured
24007  width - One of the SPI_AUDIO_COMMUNICATION_WIDTH enumeration values as the
24008  SPI buffer width
24009  Returns:
24010  None.
24011  Example:
24012  <code>
24013  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24014  // application developer.
24015  PLIB_SPI_AudioCommunicationWidthSelect(MY_SPI_INSTANCE,
24016  SPI_AUDIO_COMMUNICATION_32DATA_32FIFO_32CHANNEL);
24017  </code>
24018  Remarks:
24019  This mode is available only when PLIB_SPI_AudioProtocolEnable is enabled.
24020  This function implements an operation of the audio communication width feature.
24021  This feature may not be available on all devices. Please refer to the
24022  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioCommunicationWidth"
24023  in your application to automatically determine whether this feature is available.
24024  */
24025 
24026 void
24028  SPI_MODULE_ID index ,
24029  SPI_AUDIO_COMMUNICATION_WIDTH mode ) ;
24030 //******************************************************************************
24031 /* Function:
24032  void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index,
24033  SPI_INPUT_SAMPLING_PHASE phase)
24034  Summary:
24035  Selects the SPI data input sample phase.
24036  Description:
24037  This function selects the input sampling phase in Master mode.
24038  Precondition:
24039  None.
24040  Parameters:
24041  index - Identifier for the device instance to be configured
24042  phase - One of the SPI_INPUT_SAMPLING_PHASE as the SPI input
24043  sampling phase
24044  Returns:
24045  None.
24046  Example:
24047  <code>
24048  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24049  // application developer.
24050  PLIB_SPI_InputSamplePhaseSelect(MY_SPI_INSTANCE, SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE);
24051  </code>
24052  Remarks:
24053  This function implements an operation of the input sample phase feature.
24054  This feature may not be available on all devices. Please refer to the
24055  specific device data sheet to determine availability or use "PLIB_SPI_ExistsInputSamplePhase"
24056  in your application to automatically determine whether this feature is available.
24057  */
24058 
24059 void
24061  SPI_MODULE_ID index ,
24062  SPI_INPUT_SAMPLING_PHASE phase ) ;
24063 //******************************************************************************
24064 /* Function:
24065  void PLIB_SPI_OutputDataPhaseSelect (SPI_MODULE_ID index,
24066  SPI_OUTPUT_DATA_PHASE data)
24067  Summary:
24068  Selects serial output data change.
24069  Description:
24070  This function selects serial output data change.
24071  Precondition:
24072  None.
24073  Parameters:
24074  index - Identifier for the device instance to be configured
24075  data - One of the SPI_OUTPUT_DATA_PHASE enumeration values as the
24076  SPI serial output data change
24077  Returns:
24078  None.
24079  Example:
24080  <code>
24081  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24082  // application developer.
24083  PLIB_SPI_OutputDataPhaseSelect(MY_SPI_INSTANCE, SPI_OUTPUT_DATA_PHASE_ON_ACTIVE_TO_IDLE_CLOCK);
24084  </code>
24085  Remarks:
24086  This function implements an operation of the output data phase feature.
24087  This feature may not be available on all devices. Please refer to the
24088  specific device data sheet to determine availability or use "PLIB_SPI_ExistsOutputDataPhase"
24089  in your application to automatically determine whether this feature is available.
24090  */
24091 
24092 void
24094  SPI_MODULE_ID index ,
24095  SPI_OUTPUT_DATA_PHASE phase ) ;
24096 //******************************************************************************
24097 /* Function:
24098  void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index,
24099  SPI_CLOCK_POLARITY polarity)
24100  Summary:
24101  Enables clock polarity.
24102  Description:
24103  This function enables clock polarity.
24104  Precondition:
24105  None.
24106  Parameters:
24107  index - Identifier for the device instance to be configured
24108  polarity - One of the SPI_CLOCK_POLARITY enumeration values as the SPI clock polarity
24109  Returns:
24110  None.
24111  Example:
24112  <code>
24113  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24114  // application developer.
24115  PLIB_SPI_ClockPolaritySelect(MY_SPI_INSTANCE, SPI_CLOCK_POLARITY_IDLE_HIGH );
24116  </code>
24117  Remarks:
24118  This function implements an operation of the clock polarity feature.
24119  This feature may not be available on all devices. Please refer to the
24120  specific device data sheet to determine availability or use "PLIB_SPI_ExistsClockPolarity"
24121  in your application to automatically determine whether this feature is available.
24122  */
24123 
24124 void
24126  SPI_MODULE_ID index ,
24127  SPI_CLOCK_POLARITY polarity ) ;
24128 //******************************************************************************
24129 /* Function:
24130  void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
24131  Summary:
24132  Enables the SPI in Master mode.
24133  Description:
24134  This function enables the SPI in Master mode.
24135  This operation is atomic.
24136  Precondition:
24137  None.
24138  Parameters:
24139  index - Identifier for the device instance to be configured
24140  Returns:
24141  None.
24142  Example:
24143  <code>
24144  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24145  // application developer.
24146  PLIB_SPI_MasterEnable(MY_SPI_INSTANCE);
24147  </code>
24148  Remarks:
24149  This function implements an operation of the master enable control feature.
24150  This feature may not be available on all devices. Please refer to the
24151  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
24152  in your application to automatically determine whether this feature is available.
24153  */
24154 
24155 void
24157  SPI_MODULE_ID index ) ;
24158 //******************************************************************************
24159 /* Function:
24160  void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
24161  Summary:
24162  Enables the SPI in Slave mode.
24163  Description:
24164  This function enables the SPI in Slave mode.
24165  This operation is atomic.
24166  Precondition:
24167  None.
24168  Parameters:
24169  index - Identifier for the device instance to be configured
24170  Returns:
24171  None.
24172  Example:
24173  <code>
24174  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24175  // application developer.
24176  PLIB_SPI_SlaveEnable(MY_SPI_INSTANCE);
24177  </code>
24178  Remarks:
24179  This function implements an operation of the master enable control feature.
24180  This feature may not be available on all devices. Please refer to the
24181  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
24182  in your application to automatically determine whether this feature is available.
24183  */
24184 
24185 void
24187  SPI_MODULE_ID index ) ;
24188 //******************************************************************************
24189 /* Function:
24190  void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency,
24191  uint32_t baudRate )
24192  Summary:
24193  Sets the baud rate to the desired value.
24194  Description:
24195  This function sets the baud rate to the desired value.
24196  Precondition:
24197  None.
24198  Parameters:
24199  index - Identifier for the device instance to be configured
24200  clockFrequency - Clock frequency
24201  baudrate - Baud rate value
24202  Returns:
24203  None.
24204  Example:
24205  <code>
24206  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24207  // application developer.
24208  PLIB_SPI_BaudRateSet(MY_SPI_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
24209  </code>
24210  Remarks:
24211  Setting a new baud rate value causes the baud rate timer to reset.
24212  This ensures that the baud rate timer does not have to overflow before
24213  outputting the new baud rate.
24214  If the system clock is changed during an active receive operation, a
24215  receive error or data loss may result. To avoid this issue, verify that
24216  no receptions are in progress before changing the system clock.
24217  This function implements an operation of the baud rate set feature.
24218  This feature may not be available on all devices. Please refer to the
24219  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRate"
24220  in your application to automatically determine whether this feature is available.
24221  */
24222 
24223 void
24225  SPI_MODULE_ID index ,
24226  uint32_t clockFrequency ,
24227  uint32_t baudRate ) ;
24228 //******************************************************************************
24229 /* Function:
24230  bool PLIB_SPI_IsBusy (SPI_MODULE_ID index)
24231  Summary:
24232  Returns the current SPI module activity status.
24233  Description:
24234  This function returns the current SPI module activity status.
24235  This operation is atomic.
24236  Precondition:
24237  None.
24238  Parameters:
24239  index - Identifier for the device instance to be configured
24240  Returns:
24241  - true - SPI module is currently busy with some transactions
24242  - false - SPI module is currently idle
24243  Example:
24244  <code>
24245  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24246  // application developer.
24247  bool status = PLIB_SPI_IsBusy(MY_SPI_INSTANCE);
24248  </code>
24249  Remarks:
24250  This function implements an operation of the bus status feature.
24251  This feature may not be available on all devices. Please refer to the
24252  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBusStatus"
24253  in your application to automatically determine whether this feature is available.
24254  */
24255 
24256 bool
24257  PLIB_SPI_IsBusy (
24258  SPI_MODULE_ID index ) ;
24259 //******************************************************************************
24260 /* Function:
24261  bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
24262  Summary:
24263  Returns the current status of the receive (RX) FIFO sign-extended data.
24264  Description:
24265  This function returns the current status of the receive (RX) FIFO
24266  sign-extended data.
24267  This operation is atomic.
24268  Precondition:
24269  None.
24270  Parameters:
24271  index - Identifier for the device instance to be configured
24272  Returns:
24273  - true - Data from RX FIFO is sign-extended
24274  - false - Data from RX FIFO is not sign-extended
24275  Example:
24276  <code>
24277  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24278  // application developer.
24279  bool Status = PLIB_SPI_ReadDataIsSignExtended(MY_SPI_INSTANCE);
24280  </code>
24281  Remarks:
24282  This function implements an operation of the data sign feature.
24283  This feature may not be available on all devices. Please refer to the
24284  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReadDataSignStatus"
24285  in your application to automatically determine whether this feature is available.
24286  */
24287 
24288 bool
24290  SPI_MODULE_ID index ) ;
24291 //******************************************************************************
24292 /* Function:
24293  void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
24294  Summary:
24295  Enables Master mode slave select.
24296  Description:
24297  This function enables Master mode slave select.
24298  This operation is atomic.
24299  Precondition:
24300  None.
24301  Parameters:
24302  index - Identifier for the device instance to be configured
24303  Returns:
24304  None.
24305  Example:
24306  <code>
24307  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24308  // application developer.
24309  PLIB_SPI_SlaveSelectEnable(MY_SPI_INSTANCE);
24310  </code>
24311  Remarks:
24312  This feature does not support Framed SPI mode.
24313  This function implements an operation of the Master mode slave select feature.
24314  This feature may not be available on all devices. Please refer to the
24315  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
24316  in your application to automatically determine whether this feature is available.
24317 
24318  To enable Slave mode slave select pin (SSEN), PLIB_SPI_PinEnable API can be used.
24319  */
24320 
24321 void
24323  SPI_MODULE_ID index ) ;
24324 //******************************************************************************
24325 /* Function:
24326  void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
24327  Summary:
24328  Disables Master mode slave select.
24329  Description:
24330  This function disables Master mode slave select.
24331  This operation is atomic.
24332  Precondition:
24333  None.
24334  Parameters:
24335  index - Identifier for the device instance to be configured
24336  Returns:
24337  None.
24338  Example:
24339  <code>
24340  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24341  // application developer.
24342  PLIB_SPI_SlaveSelectDisable(MY_SPI_INSTANCE);
24343  </code>
24344  Remarks:
24345  This feature does not support Framed SPI mode.
24346  This function implements an operation of the slave select feature.
24347  This feature may not be available on all devices. Please refer to the
24348  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
24349  in your application to automatically determine whether this feature is available.
24350 
24351  To disable Slave mode slave select pin (SSEN), PLIB_SPI_PinDisable API can be used.
24352  */
24353 
24354 void
24356  SPI_MODULE_ID index ) ;
24357 //******************************************************************************
24358 /* Function:
24359  bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
24360  Summary:
24361  Returns the current status of the transmit underrun.
24362  Description:
24363  This function returns the current status of the transmit underrun.
24364  This operation is atomic.
24365  Precondition:
24366  None.
24367  Parameters:
24368  index - Identifier for the device instance to be configured
24369  Returns:
24370  - true - Transmit buffer has encountered an underrun condition
24371  - false - Transmit buffer run has not encountered an underrun condition
24372  Example:
24373  <code>
24374  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24375  // application developer.
24376  bool Status = PLIB_SPI_TransmitUnderRunStatusGet(MY_SPI_INSTANCE);
24377  </code>
24378  Remarks:
24379  Valid in Framed Sync mode.
24380  This function implements an operation of the transmit underrun status feature.
24381  This feature may not be available on all devices. Please refer to the
24382  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitUnderRunStatus"
24383  in your application to automatically determine whether this feature is available.
24384  */
24385 
24386 bool
24388  SPI_MODULE_ID index ) ;
24389 //******************************************************************************
24390 /* Function:
24391  void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
24392  Summary:
24393  Clears the SPI transmit underrun flag.
24394  Description:
24395  This function clears the SPI transmit underrun flag.
24396  This operation is atomic.
24397  Precondition:
24398  None.
24399  Parameters:
24400  index - Identifier for the device instance to be configured
24401  Returns:
24402  None.
24403  Example:
24404  <code>
24405  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24406  // application developer.
24407  PLIB_SPI_TransmitUnderRunStatusClear(MY_SPI_INSTANCE);
24408  </code>
24409  Remarks:
24410  This function implements an operation of the transmit underrun status feature.
24411  This feature may not be available on all devices. Please refer to the
24412  specific device data sheet to determine availability or use "ExistsTransmitUnderRunStatus"
24413  in your application to automatically determine whether this feature is available.
24414  */
24415 
24416 void
24418  SPI_MODULE_ID index ) ;
24419 //******************************************************************************
24420 /* Function:
24421  bool PLIB_SPI_TransmitBufferIsEmpty (SPI_MODULE_ID index)
24422  Summary:
24423  Returns the current status of the transmit buffer.
24424  Description:
24425  This function returns the current status of the transmit buffer.
24426  This operation is atomic.
24427  Precondition:
24428  None.
24429  Parameters:
24430  index - Identifier for the device instance to be configured
24431  Returns:
24432  - true - Transmit buffer is empty
24433  - false - Transmit buffer is not empty
24434  Example:
24435  <code>
24436  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24437  // application developer.
24438  bool Status = PLIB_SPI_TransmitBufferIsEmpty(MY_SPI_INSTANCE);
24439  </code>
24440  Remarks:
24441  This function implements an operation of the transmit buffer empty status feature.
24442  This feature may not be available on all devices. Please refer to the
24443  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferEmptyStatus"
24444  in your application to automatically determine whether this feature is available.
24445  */
24446 
24447 bool
24449  SPI_MODULE_ID index ) ;
24450 //******************************************************************************
24451 /* Function:
24452  void PLIB_SPI_FIFOEnable (SPI_MODULE_ID index)
24453  Summary:
24454  Enables the SPI enhanced buffer.
24455  Description:
24456  This function enables the SPI enhanced buffer.
24457  This operation is atomic.
24458  Precondition:
24459  None.
24460  Parameters:
24461  index - Identifier for the device instance to be configured
24462  Returns:
24463  None.
24464  Example:
24465  <code>
24466  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24467  // application developer.
24468  PLIB_SPI_FIFOEnable(MY_SPI_INSTANCE);
24469  </code>
24470  Remarks:
24471  This enables the enhanced buffer mode.
24472  This function implements an operation of the FIFO control feature.
24473  This feature may not be available on all devices. Please refer to the
24474  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24475  in your application to automatically determine whether this feature is available.
24476  */
24477 
24478 void
24480  SPI_MODULE_ID index ) ;
24481 //******************************************************************************
24482 /* Function:
24483  void PLIB_SPI_FIFODisable (SPI_MODULE_ID index)
24484  Summary:
24485  Disables the SPI enhanced buffer.
24486  Description:
24487  This function disables the SPI enhanced buffer.
24488  This operation is atomic.
24489  Precondition:
24490  None.
24491  Parameters:
24492  index - Identifier for the device instance to be configured
24493  Returns:
24494  None.
24495  Example:
24496  <code>
24497  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24498  // application developer.
24499  PLIB_SPI_FIFODisable(MY_SPI_INSTANCE);
24500  </code>
24501  Remarks:
24502  Enables the legacy standard single buffer mode.
24503  This function implements an operation of the FIFO control feature.
24504  This feature may not be available on all devices. Please refer to the
24505  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24506  in your application to automatically determine whether this feature is available.
24507  */
24508 
24509 void
24511  SPI_MODULE_ID index ) ;
24512 //******************************************************************************
24513 /* Function:
24514  uint8_t PLIB_SPI_FIFOCountGet (SPI_MODULE_ID index, SPI_FIFO_TYPE type)
24515  Summary:
24516  Reads the SPI Buffer Element Count bits for either receive or transmit.
24517  Description:
24518  This function reads the number of SPI transfers pending for Master mode
24519  and the number of unread SPI transfers for Slave mode.
24520  Precondition:
24521  None.
24522  Parameters:
24523  index - Identifier for the device instance to be configured
24524  type - One of the SPI_FIFO_TYPE enumeration values
24525  Returns:
24526  CountValue - Buffer element count bits
24527  Example:
24528  <code>
24529  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24530  // application developer.
24531  uint8_t count = PLIB_SPI_FIFOCountGet(MY_SPI_INSTANCE,SPI_FIFO_TYPE_TRANSMIT);
24532  </code>
24533  Remarks:
24534  Valid in Enhanced Buffer mode.
24535  This function implements an operation of the FIFO control feature.
24536  This feature may not be available on all devices. Please refer to the
24537  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOCount"
24538  in your application to automatically determine whether this feature is available.
24539  */
24540 
24541 uint8_t
24543  SPI_MODULE_ID index ,
24544  SPI_FIFO_TYPE type ) ;
24545 //******************************************************************************
24546 /* Function:
24547  bool PLIB_SPI_FIFOShiftRegisterIsEmpty (SPI_MODULE_ID index)
24548  Summary:
24549  Returns the current status of the SPI shift register.
24550  Description:
24551  This function returns the current status of the SPI shift register.
24552  This operation is atomic.
24553  Precondition:
24554  None.
24555  Parameters:
24556  index - Identifier for the device instance to be configured
24557  Returns:
24558  - true - SPI shift register is empty and ready to send or receive
24559  - false - SPI shift register is not empty
24560  Example:
24561  <code>
24562  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24563  // application developer.
24564  bool Status = PLIB_SPI_FIFOShiftRegisterIsEmpty(MY_SPI_INSTANCE);
24565  </code>
24566  Remarks:
24567  Valid in Enhanced Buffer mode.
24568  This function implements an operation of the FIFO status feature.
24569  This feature may not be available on all devices. Please refer to the
24570  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus"
24571  in your application to automatically determine whether this feature is available.
24572  */
24573 
24574 bool
24576  SPI_MODULE_ID index ) ;
24577 //******************************************************************************
24578 /* Function:
24579  bool PLIB_SPI_ReceiverFIFOIsEmpty (SPI_MODULE_ID index)
24580  Summary:
24581  Returns the current status of the SPI receive FIFO.
24582  Description:
24583  This function returns the current status of the SPI receive FIFO.
24584  This operation is atomic.
24585  Precondition:
24586  None.
24587  Parameters:
24588  index - Identifier for the device instance to be configured
24589  Returns:
24590  - true - Receive FIFO is empty
24591  - false - Receive FIFO is not empty
24592  Example:
24593  <code>
24594  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24595  // application developer.
24596  bool fifostate = PLIB_SPI_ReceiverFIFOIsEmpty (MY_SPI_INSTANCE);
24597  </code>
24598  Remarks:
24599  Valid in Enhanced Buffer mode.
24600  This function implements an operation of the FIFO status feature.
24601  This feature may not be available on all devices. Please refer to the
24602  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveFIFOStatus"
24603  in your application to automatically determine whether this feature is available.
24604  */
24605 
24606 bool
24608  SPI_MODULE_ID index ) ;
24609 //******************************************************************************
24610 /* Function:
24611  void PLIB_SPI_FIFOInterruptModeSelect (SPI_MODULE_ID index,
24612  SPI_FIFO_INTERRUPT mode)
24613  Summary:
24614  Selects the SPI buffer interrupt mode.
24615  Description:
24616  This function selects the SPI buffer interrupt mode from SPI_FIFO_INTERRUPT.
24617  Precondition:
24618  None.
24619  Parameters:
24620  index - Identifier for the device instance to be configured
24621  mode - One of the SPI_FIFO_INTERRUPT enumeration values as the SPI buffer
24622  interrupt mode
24623  Returns:
24624  None.
24625  Example:
24626  <code>
24627  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24628  // application developer.
24629  PLIB_SPI_FIFOInterruptModeSelect(MY_SPI_INSTANCE,
24630  SPI_FIFO_INTERRUPT_WHEN_TRANSMIT_BUFFER_IS_NOT_FULL);
24631  </code>
24632  Remarks:
24633  Valid in Enhanced Buffer mode.
24634  This function implements an operation of the FIFO interrupt feature.
24635  This feature may not be available on all devices. Please refer to the
24636  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOInterruptMode"
24637  in your application to automatically determine whether this feature is available.
24638  */
24639 
24640 void
24642  SPI_MODULE_ID index ,
24643  SPI_FIFO_INTERRUPT mode ) ;
24644 //******************************************************************************
24645 /* Function:
24646  void PLIB_SPI_FramedCommunicationEnable (SPI_MODULE_ID index)
24647  Summary:
24648  Enables framed SPI support.
24649  Description:
24650  This function enables framed SPI support.
24651  This operation is atomic.
24652  Precondition:
24653  None.
24654  Parameters:
24655  index - Identifier for the device instance to be configured
24656  Returns:
24657  None.
24658  Example:
24659  <code>
24660  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24661  // application developer.
24662  PLIB_SPI_FramedCommunicationEnable(MY_SPI_INSTANCE);
24663  </code>
24664  Remarks:
24665  This function implements an operation of the framed communication feature.
24666  This feature may not be available on all devices. Please refer to the
24667  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24668  in your application to automatically determine whether this feature is available.
24669  */
24670 
24671 void
24673  SPI_MODULE_ID index ) ;
24674 //******************************************************************************
24675 /* Function:
24676  void PLIB_SPI_FramedCommunicationDisable (SPI_MODULE_ID index)
24677  Summary:
24678  Disables framed SPI support.
24679  Description:
24680  This function disables framed SPI support.
24681  This operation is atomic.
24682  Precondition:
24683  None.
24684  Parameters:
24685  index - Identifier for the device instance to be configured
24686  Returns:
24687  None.
24688  Example:
24689  <code>
24690  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24691  // application developer.
24692  PLIB_SPI_FramedCommunicationDisable(MY_SPI_INSTANCE);
24693  </code>
24694  Remarks:
24695  This function implements an operation of the framed communication feature.
24696  This feature may not be available on all devices. Please refer to the
24697  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24698  in your application to automatically determine whether this feature is available.
24699  */
24700 
24701 void
24703  SPI_MODULE_ID index ) ;
24704 //******************************************************************************
24705 /* Function:
24706  void PLIB_SPI_FrameSyncPulseDirectionSelect (SPI_MODULE_ID index,
24707  SPI_FRAME_PULSE_DIRECTION direction)
24708  Summary:
24709  Selects the frame sync pulse direction.
24710  Description:
24711  This function selects the frame sync pulse direction.
24712  Precondition:
24713  None.
24714  Parameters:
24715  index - Identifier for the device instance to be configured
24716  direction - One of the SPI_FRAME_PULSE_DIRECTION enumeration values
24717  as the SPI frame sync pulse polarity
24718  Returns:
24719  None.
24720  Example:
24721  <code>
24722  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24723  // application developer.
24724  PLIB_SPI_FrameSyncPulseDirectionSelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_DIRECTION_INPUT );
24725  </code>
24726  Remarks:
24727  This function implements an operation of the framed communication feature.
24728  This feature may not be available on all devices. Please refer to the
24729  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseDirection"
24730  in your application to automatically determine whether this feature is available.
24731  */
24732 
24733 void
24735  SPI_MODULE_ID index ,
24736  SPI_FRAME_PULSE_DIRECTION direction ) ;
24737 //******************************************************************************
24738 /* Function:
24739  void PLIB_SPI_FrameSyncPulsePolaritySelect (SPI_MODULE_ID index,
24740  SPI_FRAME_PULSE_POLARITY polarity)
24741  Summary:
24742  Selects the frame sync pulse polarity.
24743  Description:
24744  This function selects the frame sync pulse polarity.
24745  Precondition:
24746  None.
24747  Parameters:
24748  index - Identifier for the device instance to be configured
24749  polarity - One of the SPI_FRAME_PULSE_POLARITY enumeration values as the SPI frame
24750  sync pulse polarity
24751  Returns:
24752  None.
24753  Example:
24754  <code>
24755  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24756  // application developer.
24757  PLIB_SPI_FrameSyncPulsePolaritySelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_POLARITY_ACTIVE_HIGH );
24758  </code>
24759  Remarks:
24760  Available only for Frame mode.
24761  This function implements an operation of the framed communication feature.
24762  This feature may not be available on all devices. Please refer to the
24763  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulsePolarity"
24764  in your application to automatically determine whether this feature is available.
24765  */
24766 
24767 void
24769  SPI_MODULE_ID index ,
24770  SPI_FRAME_PULSE_POLARITY polarity ) ;
24771 //******************************************************************************
24772 /* Function:
24773  void PLIB_SPI_FrameSyncPulseEdgeSelect (SPI_MODULE_ID index,
24774  SPI_FRAME_PULSE_EDGE edge)
24775  Summary:
24776  Selects the frame sync pulse edge.
24777  Description:
24778  This function selects the frame sync pulse edge.
24779  Precondition:
24780  None.
24781  Parameters:
24782  index - Identifier for the device instance to be configured
24783  edge - One of the SPI_FRAME_PULSE_EDGE enumeration values as the
24784  SPI frame sync pulse edge
24785  Returns:
24786  None.
24787  Example:
24788  <code>
24789  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24790  // application developer.
24791  PLIB_SPI_FrameSyncPulseEdgeSelect(MY_SPI_INSTANCE,
24792  SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK);
24793  </code>
24794  Remarks:
24795  This function implements an operation of the framed communication feature.
24796  This feature may not be available on all devices. Please refer to the
24797  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseEdge"
24798  in your application to automatically determine whether this feature is available.
24799  */
24800 
24801 void
24803  SPI_MODULE_ID index ,
24804  SPI_FRAME_PULSE_EDGE edge ) ;
24805 //******************************************************************************
24806 /* Function:
24807  void PLIB_SPI_FrameSyncPulseWidthSelect (SPI_MODULE_ID index,
24808  SPI_FRAME_PULSE_WIDTH width)
24809  Summary:
24810  Sets the frame sync pulse width.
24811  Description:
24812  This function sets the frame sync pulse width.
24813  Precondition:
24814  None.
24815  Parameters:
24816  index - Identifier for the device instance to be configured
24817  edge - One of the SPI_FRAME_PULSE_WIDTH enumeration values as the SPI
24818  frame sync pulse width.
24819  Returns:
24820  None.
24821  Example:
24822  <code>
24823  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24824  // application developer.
24825  PLIB_SPI_FrameSyncPulseWidthSelect (MY_SPI_INSTANCE,SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH);
24826  </code>
24827  Remarks:
24828  Length of the word is dependent on the communication mode.
24829  This function implements an operation of the framed communication feature.
24830  This feature may not be available on all devices. Please refer to the
24831  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseWidth"
24832  in your application to automatically determine whether this feature is available.
24833  */
24834 
24835 void
24837  SPI_MODULE_ID index ,
24838  SPI_FRAME_PULSE_WIDTH width ) ;
24839 //******************************************************************************
24840 /* Function:
24841  void PLIB_SPI_FrameSyncPulseCounterSelect (SPI_MODULE_ID index,
24842  SPI_FRAME_SYNC_PULSE pulse)
24843  Summary:
24844  Selects at which character the SPI frame sync pulse is generated.
24845  Description:
24846  This function selects at which character the SPI frame sync pulse is generated.
24847  Precondition:
24848  None.
24849  Parameters:
24850  index - Identifier for the device instance to be configured
24851  pulse - One of the SPI_FRAME_SYNC_PULSE enumeration values as the SPI
24852  frame sync pulse count
24853  Returns:
24854  None.
24855  Example:
24856  <code>
24857  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24858  // application developer.
24859  PLIB_SPI_FrameSyncPulseCounterSelect(MY_SPI_INSTANCE,
24860  SPI_FRAME_SYNC_PULSE_ON_EVERY_32_DATA_CHARACTER );
24861  </code>
24862  Remarks:
24863  This is valid only when PLIB_SPI_FramedCommunicationEnable is enabled.
24864  This function implements an operation of the framed communication feature.
24865  This feature may not be available on all devices. Please refer to the
24866  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseCounter"
24867  in your application to automatically determine whether this feature is available.
24868  */
24869 
24870 void
24872  SPI_MODULE_ID index ,
24873  SPI_FRAME_SYNC_PULSE pulse ) ;
24874 //******************************************************************************
24875 /* Function:
24876  bool PLIB_SPI_FrameErrorStatusGet (SPI_MODULE_ID index)
24877  Summary:
24878  Returns the current status of the SPI frame error.
24879  Description:
24880  This function returns the current status of the SPI frame error.
24881  This operation is atomic.
24882  Precondition:
24883  None.
24884  Parameters:
24885  index - Identifier for the device instance to be configured
24886  Returns:
24887  - true - Frame error detected
24888  - false - No frame error detected
24889  Example:
24890  <code>
24891  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24892  // application developer.
24893  bool status = PLIB_SPI_FrameErrorStatusGet(MY_SPI_INSTANCE);
24894  </code>
24895  Remarks:
24896  Valid only if Frame mode is enabled.
24897  This function implements an operation of the framed communication feature.
24898  This feature may not be available on all devices. Please refer to the
24899  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameErrorStatus"
24900  in your application to automatically determine whether this feature is available.
24901  */
24902 
24903 bool
24905  SPI_MODULE_ID index ) ;
24906 //******************************************************************************
24907 /* Function:
24908  void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
24909  Summary:
24910  Clears the SPI frame error flag.
24911  Description:
24912  This function clears the SPI frame error flag.
24913  This operation is atomic.
24914  Precondition:
24915  None.
24916  Parameters:
24917  index - Identifier for the device instance to be configured
24918  Returns:
24919  None.
24920  Example:
24921  <code>
24922  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24923  // application developer.
24924  PLIB_SPI_FrameErrorStatusClear(MY_SPI_INSTANCE);
24925  </code>
24926  Remarks:
24927  This function implements an operation of the frame error status feature.
24928  This feature may not be available on all devices. Please refer to the
24929  specific device data sheet to determine availability or use "ExistsFrameErrorStatus"
24930  in your application to automatically determine whether this feature is available.
24931  */
24932 
24933 void
24935  SPI_MODULE_ID index ) ;
24936 //******************************************************************************
24937 /* Function:
24938  void PLIB_SPI_BufferClear (SPI_MODULE_ID index)
24939  Summary:
24940  Clears the SPI receive buffer.
24941  Description:
24942  This function clears the SPI receive buffer.
24943  In Enhanced Buffer mode, this functions clears the full RX FIFO.
24944  This operation is atomic.
24945  Precondition:
24946  None.
24947  Parameters:
24948  index - Identifier for the device instance to be configured
24949  Returns:
24950  None.
24951  Example:
24952  <code>
24953  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24954  // application developer.
24955  //This call will flush the receive buffer.
24956  PLIB_SPI_BufferClear(MY_SPI_INSTANCE);
24957  </code>
24958  Remarks:
24959  This function implements an operation of the buffer control feature.
24960  This feature may not be available on all devices. Please refer to the
24961  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24962  in your application to automatically determine whether this feature is available.
24963  */
24964 
24965 void
24967  SPI_MODULE_ID index ) ;
24968 //******************************************************************************
24969 /* Function:
24970  uint8_t PLIB_SPI_BufferRead (SPI_MODULE_ID index)
24971  Summary:
24972  Returns the SPI buffer value.
24973  Description:
24974  This function returns the SPI buffer value.
24975  This operation is atomic.
24976  Precondition:
24977  None.
24978  Parameters:
24979  index - Identifier for the device instance to be configured
24980  Returns:
24981  Reads the SPI buffer.
24982  Example:
24983  <code>
24984  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24985  // application developer.
24986  uint8_t bufferValue = PLIB_SPI_BufferRead(MY_SPI_INSTANCE);
24987  </code>
24988  Remarks:
24989  This function implements an operation of the buffer control feature.
24990  This feature may not be available on all devices. Please refer to the
24991  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24992  in your application to automatically determine whether this feature is available.
24993  */
24994 
24995 uint8_t
24997  SPI_MODULE_ID index ) ;
24998 //******************************************************************************
24999 /* Function:
25000  uint16_t PLIB_SPI_BufferRead16bit ( SPI_MODULE_ID index )
25001  Summary:
25002  Returns 16-bit SPI buffer value.
25003  Description:
25004  This function returns 16-bit SPI buffer value.
25005  This operation is atomic.
25006  Precondition:
25007  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
25008  Parameters:
25009  index - Identifier for the device instance to be configured
25010  Returns:
25011  Returns the SPI 16-bit buffer value.
25012  Example:
25013  <code>
25014 #define MY_SPI_INSTANCE SPI_ID_1
25015 
25016  uint16_t bufferValue = PLIB_SPI_BufferRead16bit( MY_SPI_INSTANCE );
25017  </code>
25018  Remarks:
25019  This function implements an operation of the buffer control feature.
25020  This feature may not be available on all devices. Please refer to the
25021  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
25022  in your application to automatically determine whether this feature is available.
25023  */
25024 
25025 uint16_t
25027  SPI_MODULE_ID index ) ;
25028 //******************************************************************************
25029 /* Function:
25030  uint32_t PLIB_SPI_BufferRead32bit ( SPI_MODULE_ID index )
25031  Summary:
25032  Returns 32-bit SPI buffer value.
25033  Description:
25034  This function returns 32-bit SPI buffer value.
25035  This operation is atomic.
25036  Precondition:
25037  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
25038  Parameters:
25039  index - Identifier for the device instance to be configured
25040  Returns:
25041  Returns the SPI 32-bit buffer value.
25042  Example:
25043  <code>
25044 #define MY_SPI_INSTANCE SPI_ID_1
25045 
25046  uint32_t bufferValue = PLIB_SPI_BufferRead32bit( MY_SPI_INSTANCE );
25047  </code>
25048  Remarks:
25049  This function implements an operation of the buffer control feature.
25050  This feature may not be available on all devices. Please refer to the
25051  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
25052  in your application to automatically determine whether this feature is available.
25053  */
25054 
25055 uint32_t
25057  SPI_MODULE_ID index ) ;
25058 //******************************************************************************
25059 /* Function:
25060  void PLIB_SPI_BufferWrite ( SPI_MODULE_ID index , uint8_t data )
25061  Summary:
25062  Write the data to the SPI buffer.
25063  Description:
25064  This function writes data to the SPI buffer.
25065  This operation is atomic.
25066  Precondition:
25067  None.
25068  Parameters:
25069  index - Identifier for the device instance to be configured
25070  data - Data to written to the SPI buffer
25071  Returns:
25072  None.
25073  Example:
25074  <code>
25075  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25076  // application developer.
25077  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0xFF );
25078  </code>
25079  Remarks:
25080  This function implements an operation of the buffer control feature.
25081  This feature may not be available on all devices. Please refer to the
25082  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
25083  in your application to automatically determine whether this feature is available.
25084  */
25085 
25086 void
25088  SPI_MODULE_ID index ,
25089  uint8_t data ) ;
25090 //******************************************************************************
25091 /* Function:
25092  void PLIB_SPI_BufferWrite16bit ( SPI_MODULE_ID index , uint16_t data )
25093  Summary:
25094  Writes 16-bit data to the SPI buffer.
25095  Description:
25096  This function writes 16-bit data to the SPI buffer.
25097  This operation is atomic.
25098  Precondition:
25099  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
25100  Parameters:
25101  index - Identifier for the device instance to be configured
25102  data - 16-bit data to be written to the SPI buffer
25103  Returns:
25104  None.
25105  Example:
25106  <code>
25107 #define MY_SPI_INSTANCE SPI_ID_1
25108 
25109  PLIB_SPI_BufferWrite16bit ( MY_SPI_INSTANCE, 0x55AA );
25110  </code>
25111  Remarks:
25112  This function implements an operation of the buffer control feature.
25113  This feature may not be available on all devices. Please refer to the
25114  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
25115  in your application to automatically determine whether this feature is available.
25116  */
25117 
25118 void
25120  SPI_MODULE_ID index ,
25121  uint16_t data ) ;
25122 //******************************************************************************
25123 /* Function:
25124  void PLIB_SPI_BufferWrite32bit ( SPI_MODULE_ID index , uint32_t data )
25125  Summary:
25126  Write 32-bit data to the SPI buffer.
25127  Description:
25128  This function writes 32-bit data to the SPI buffer.
25129  This operation is atomic.
25130  Precondition:
25131  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
25132  Parameters:
25133  index - Identifier for the device instance to be configured
25134  data - 32-bit data to be written to the SPI buffer
25135  Returns:
25136  None.
25137  Example:
25138  <code>
25139 #define MY_SPI_INSTANCE SPI_ID_1
25140 
25141  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0x55AA55AA );
25142  </code>
25143  Remarks:
25144  This function implements an operation of the buffer control feature.
25145  This feature may not be available on all devices. Please refer to the
25146  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
25147  in your application to automatically determine whether this feature is available.
25148  */
25149 
25150 void
25152  SPI_MODULE_ID index ,
25153  uint32_t data ) ;
25154 //******************************************************************************
25155 /* Function : PLIB_SPI_BufferAddressGet( SPI_MODULE_ID index )
25156  Summary:
25157  Returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive (SPIxRXB))
25158  register.
25159  Description:
25160  This function returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive
25161  (SPIxRXB)) register.
25162  This operation is atomic.
25163  Preconditions:
25164  None.
25165  Parameters:
25166  index - Identifier for the device instance
25167  Returns:
25168  The address of the SPIxBUF register
25169  Remarks:
25170  None.
25171 */
25172 
25173 void *
25175  SPI_MODULE_ID index ) ;
25176 //******************************************************************************
25177 /* Function:
25178  void PLIB_SPI_BaudRateClockSelect (SPI_MODULE_ID index,
25179  SPI_BAUD_RATE_CLOCK type)
25180  Summary:
25181  Selects the type of clock is used by the Baud Rate Generator.
25182  Description:
25183  This function selects the type of clock is used by the Baud Rate Generator.
25184  Precondition:
25185  None.
25186  Parameters:
25187  index - Identifier for the device instance to be configured
25188  type - One of the SPI_BAUD_RATE_CLOCK enumeration values as the SPI baud clock
25189  Returns:
25190  None.
25191  Example:
25192  <code>
25193  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25194  // application developer.
25195  PLIB_SPI_BaudRateClockSelect (MY_SPI_INSTANCE, SPI_BAUD_RATE_MCLK_CLOCK);
25196  </code>
25197  Remarks:
25198  This function implements an operation of the baud rate clock control feature.
25199  This feature may not be available on all devices. Please refer to the
25200  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRateClock"
25201  in your application to automatically determine whether this feature is available.
25202  */
25203 
25204 void
25206  SPI_MODULE_ID index ,
25207  SPI_BAUD_RATE_CLOCK type ) ;
25208 //******************************************************************************
25209 /* Function:
25210  void PLIB_SPI_ErrorInterruptEnable (SPI_MODULE_ID index,
25211  SPI_ERROR_INTERRUPT error)
25212  Summary:
25213  Enables SPI error interrupts
25214  Description:
25215  This function enables SPI error interrupts.
25216  Precondition:
25217  None.
25218  Parameters:
25219  index - Identifier for the device instance to be configured
25220  type - One of the SPI_ERROR_INTERRUPT enumeration values as the
25221  SPI interrupt error
25222  Returns:
25223  None.
25224  Example:
25225  <code>
25226  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25227  // application developer.
25228  PLIB_SPI_ErrorInterruptEnable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
25229  </code>
25230  Remarks:
25231  This function implements an operation of the error interrupt control feature.
25232  This feature may not be available on all devices. Please refer to the
25233  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
25234  in your application to automatically determine whether this feature is available.
25235  */
25236 
25237 void
25239  SPI_MODULE_ID index ,
25240  SPI_ERROR_INTERRUPT error ) ;
25241 //******************************************************************************
25242 /* Function:
25243  void PLIB_SPI_ErrorInterruptDisable (SPI_MODULE_ID index,
25244  SPI_ERROR_INTERRUPT error)
25245  Summary:
25246  Enables SPI error interrupts.
25247  Description:
25248  This function enables SPI error interrupts.
25249  Precondition:
25250  None.
25251  Parameters:
25252  index - Identifier for the device instance to be configured
25253  error - One of the SPI_ERROR_INTERRUPT enumeration values as the
25254  SPI interrupt error
25255  Returns:
25256  None.
25257  Example:
25258  <code>
25259  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25260  // application developer.
25261  PLIB_SPI_ErrorInterruptDisable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
25262  </code>
25263  Remarks:
25264  This function implements an operation of the error interrupt control feature.
25265  This feature may not be available on all devices. Please refer to the
25266  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
25267  in your application to automatically determine whether this feature is available.
25268  */
25269 
25270 void
25272  SPI_MODULE_ID index ,
25273  SPI_ERROR_INTERRUPT error ) ;
25274 //******************************************************************************
25275 /* Function:
25276  void PLIB_SPI_AudioErrorEnable (SPI_MODULE_ID index, SPI_Audio_ERROR error)
25277  Summary:
25278  Enables the SPI error.
25279  Description:
25280  This function enables the SPI error.
25281  This operation is atomic.
25282  Precondition:
25283  None.
25284  Parameters:
25285  index - Identifier for the device instance to be configured
25286  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
25287  Returns:
25288  None.
25289  Example:
25290  <code>
25291  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25292  // application developer.
25293  PLIB_SPI_AudioErrorEnable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
25294  </code>
25295  Remarks:
25296  This function implements an operation of the audio error control feature.
25297  This feature may not be available on all devices. Please refer to the
25298  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
25299  in your application to automatically determine whether this feature is available.
25300  */
25301 
25302 void
25304  SPI_MODULE_ID index ,
25305  SPI_AUDIO_ERROR error ) ;
25306 //******************************************************************************
25307 /* Function:
25308  void PLIB_SPI_AudioErrorDisable (SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
25309  Summary:
25310  Disables the SPI error.
25311  Description:
25312  This function disables the SPI error.
25313  This operation is atomic.
25314  Precondition:
25315  None.
25316  Parameters:
25317  index - Identifier for the device instance to be configured
25318  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
25319  Returns:
25320  None.
25321  Example:
25322  <code>
25323  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25324  // application developer.
25325  PLIB_SPI_AudioErrorDisable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
25326  </code>
25327  Remarks:
25328  This function implements an operation of the audio error control feature.
25329  This feature may not be available on all devices. Please refer to the
25330  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
25331  in your application to automatically determine whether this feature is available.
25332  */
25333 
25334 void
25336  SPI_MODULE_ID index ,
25337  SPI_AUDIO_ERROR error ) ;
25338 //******************************************************************************
25339 /* Function:
25340  void PLIB_SPI_AudioProtocolEnable (SPI_MODULE_ID index)
25341  Summary:
25342  Audio protocol is enabled.
25343  Description:
25344  This function enables the audio protocol.
25345  This operation is atomic.
25346  Precondition:
25347  Disable the SPI module by calling PLIB_SPI_Disable.
25348  Parameters:
25349  index - Identifier for the device instance to be configured
25350  Returns:
25351  None.
25352  Example:
25353  <code>
25354  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25355  // application developer.
25356  PLIB_SPI_AudioProtocolEnable(MY_SPI_INSTANCE);
25357  </code>
25358  Remarks:
25359  This function implements an operation of the audio protocol control feature.
25360  This feature may not be available on all devices. Please refer to the
25361  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25362  in your application to automatically determine whether this feature is available.
25363  */
25364 
25365 void
25367  SPI_MODULE_ID index ) ;
25368 //******************************************************************************
25369 /* Function:
25370  void PLIB_SPI_AudioProtocolDisable (SPI_MODULE_ID index)
25371  Summary:
25372  Audio protocol is disabled.
25373  Description:
25374  This function disables the audio protocol.
25375  This operation is atomic.
25376  Precondition:
25377  None.
25378  Parameters:
25379  index - Identifier for the device instance to be configured
25380  Returns:
25381  None.
25382  Example:
25383  <code>
25384  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25385  // application developer.
25386  PLIB_SPI_AudioProtocolDisable(MY_SPI_INSTANCE);
25387  </code>
25388  Remarks:
25389  This function implements an operation of the audio protocol control feature.
25390  This feature may not be available on all devices. Please refer to the
25391  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25392  in your application to automatically determine whether this feature is available.
25393  */
25394 
25395 void
25397  SPI_MODULE_ID index ) ;
25398 //******************************************************************************
25399 /* Function:
25400  void PLIB_SPI_AudioTransmitModeSelect (SPI_MODULE_ID index,
25401  SPI_AUDIO_TRANSMIT_MODE mode)
25402  Summary:
25403  Selects the transmit audio data format.
25404  Description:
25405  This function selects the transmit audio data format.
25406  Precondition:
25407  None.
25408  Parameters:
25409  index - Identifier for the device instance to be configured
25410  mode - One of the SPI_TRANSMIT_AUDIO_MODE enumeration values as the
25411  transmit audio format
25412  Returns:
25413  None.
25414  Example:
25415  <code>
25416  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25417  // application developer.
25418  PLIB_SPI_AudioTransmitModeSelect (MY_SPI_INSTANCE, SPI_AUDIO_TRANSMIT_MONO);
25419  </code>
25420  Remarks:
25421  This function implements an operation of the audio transmit mode feature.
25422  This feature may not be available on all devices. Please refer to the
25423  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioTransmitMode"
25424  in your application to automatically determine whether this feature is available.
25425  */
25426 
25427 void
25429  SPI_MODULE_ID index ,
25430  SPI_AUDIO_TRANSMIT_MODE mode ) ;
25431 //******************************************************************************
25432 /* Function:
25433  void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index,
25434  SPI_AUDIO_PROTOCOL mode )
25435  Summary:
25436  Selects the Audio Protocol mode.
25437  Description:
25438  This function selects the Audio Protocol mode.
25439  Precondition:
25440  None.
25441  Parameters:
25442  index - Identifier for the device instance to be configured
25443  mode - One of the SPI_AUDIO_PROTOCOL enumeration values as the
25444  audio protocol
25445  Returns:
25446  None.
25447  Example:
25448  <code>
25449  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25450  // application developer.
25451  PLIB_SPI_AudioProtocolModeSelect(MY_SPI_INSTANCE,SPI_AUDIO_PROTOCOL_RIGHT_JUSTIFIED );
25452  </code>
25453  Remarks:
25454  This function implements an operation of the audio protocol mode feature.
25455  This feature may not be available on all devices. Please refer to the
25456  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolMode"
25457  in your application to automatically determine whether this feature is available.
25458  */
25459 
25460 void
25462  SPI_MODULE_ID index ,
25463  SPI_AUDIO_PROTOCOL mode ) ;
25464 // *****************************************************************************
25465 // *****************************************************************************
25466 // Section: SPI Peripheral Library Exists Functions
25467 // *****************************************************************************
25468 // *****************************************************************************
25469 /* The following functions indicate the existence of the features on the device.
25470 */
25471 //******************************************************************************
25472 /* Function:
25473  PLIB_SPI_ExistsEnableControl( SPI_MODULE_ID index )
25474  Summary:
25475  Identifies whether the EnableControl feature exists on the SPI module.
25476  Description:
25477  This function identifies whether the EnableControl feature is available on
25478  the SPI module.
25479  When this function returns true, these functions are supported on the device:
25480  - PLIB_SPI_Enable
25481  - PLIB_SPI_Disable
25482  This operation is atomic.
25483  Preconditions:
25484  None.
25485  Parameters:
25486  index - Identifier for the device instance
25487  Returns:
25488  - true - The EnableControl feature is supported on the device
25489  - false - The EnableControl feature is not supported on the device
25490  Remarks:
25491  None.
25492 */
25493 
25494 bool
25496  SPI_MODULE_ID index ) ;
25497 //******************************************************************************
25498 /* Function:
25499  PLIB_SPI_ExistsStopInIdleControl( SPI_MODULE_ID index )
25500  Summary:
25501  Identifies whether the StopInIdle feature exists on the SPI module.
25502  Description:
25503  This function identifies whether the StopInIdle feature is available on the
25504  SPI module.
25505  When this function returns true, these functions are supported on the device:
25506  - PLIB_SPI_StopInIdleEnable
25507  - PLIB_SPI_StopInIdleDisable
25508  This operation is atomic.
25509  Preconditions:
25510  None.
25511  Parameters:
25512  index - Identifier for the device instance
25513  Returns:
25514  - true - The StopInIdle feature is supported on the device
25515  - false - The StopInIdle feature is not supported on the device
25516  Remarks:
25517  None.
25518 */
25519 
25520 bool
25522  SPI_MODULE_ID index ) ;
25523 //******************************************************************************
25524 /* Function:
25525  PLIB_SPI_ExistsReceiverOverflow( SPI_MODULE_ID index )
25526  Summary:
25527  Identifies whether the ReceiverOverflow feature exists on the SPI module.
25528  Description:
25529  This function identifies whether the ReceiverOverflow feature is available
25530  on the SPI module.
25531  When this function returns true, these functions are supported on the device:
25532  - PLIB_SPI_ReceiverHasOverflowed
25533  - PLIB_SPI_ReceiverOverflowClear
25534  This operation is atomic.
25535  Preconditions:
25536  None.
25537  Parameters:
25538  index - Identifier for the device instance
25539  Returns:
25540  - true - The ReceiverOverflow feature is supported on the device
25541  - false - The ReceiverOverflow feature is not supported on the device
25542  Remarks:
25543  None.
25544 */
25545 
25546 bool
25548  SPI_MODULE_ID index ) ;
25549 //******************************************************************************
25550 /* Function:
25551  PLIB_SPI_ExistsTransmitBufferFullStatus( SPI_MODULE_ID index )
25552  Summary:
25553  Identifies whether the TransmitBufferFullStatus feature exists on the SPI module.
25554  Description:
25555  This function identifies whether the TransmitBufferFullStatus feature is available
25556  on the SPI module.
25557  When this function returns true, this function is supported on the device:
25558  - PLIB_SPI_TransmitBufferIsFull
25559  This operation is atomic.
25560  Preconditions:
25561  None.
25562  Parameters:
25563  index - Identifier for the device instance
25564  Returns:
25565  - true - The TransmitBufferFullStatus feature is supported on the device
25566  - false - The TransmitBufferFullStatus feature is not supported on the device
25567  Remarks:
25568  None.
25569 */
25570 
25571 bool
25573  SPI_MODULE_ID index ) ;
25574 //******************************************************************************
25575 /* Function:
25576  PLIB_SPI_ExistsTransmitBufferEmptyStatus( SPI_MODULE_ID index )
25577  Summary:
25578  Identifies whether the TransmitBufferEmptyStatus feature exists on the SPI module.
25579  Description:
25580  This function identifies whether the TransmitBufferEmptyStatus feature is available
25581  on the SPI module.
25582  When this function returns true, this function is supported on the device:
25583  - PLIB_SPI_TransmitBufferIsEmpty
25584  This operation is atomic.
25585  Preconditions:
25586  None.
25587  Parameters:
25588  index - Identifier for the device instance
25589  Returns:
25590  - true - The TransmitBufferEmptyStatus feature is supported on the device
25591  - false - The TransmitBufferEmptyStatus feature is not supported on the device
25592  Remarks:
25593  None.
25594 */
25595 
25596 bool
25598  SPI_MODULE_ID index ) ;
25599 //******************************************************************************
25600 /* Function:
25601  PLIB_SPI_ExistsReceiveBufferStatus( SPI_MODULE_ID index )
25602  Summary:
25603  Identifies whether the ReceiveBufferStatus feature exists on the SPI module.
25604  Description:
25605  This function identifies whether the ReceiveBufferStatus feature is available
25606  on the SPI module.
25607  When this function returns true, this function is supported on the device:
25608  - PLIB_SPI_ReceiverBufferIsFull
25609  This operation is atomic.
25610  Preconditions:
25611  None.
25612  Parameters:
25613  index - Identifier for the device instance
25614  Returns:
25615  - true - The ReceiveBufferStatus feature is supported on the device
25616  - false - The ReceiveBufferStatus feature is not supported on the device
25617  Remarks:
25618  None.
25619 */
25620 
25621 bool
25623  SPI_MODULE_ID index ) ;
25624 //******************************************************************************
25625 /* Function:
25626  PLIB_SPI_ExistsPinControl( SPI_MODULE_ID index )
25627  Summary:
25628  Identifies whether the PinControl feature exists on the SPI module.
25629  Description:
25630  This function identifies whether the PinControl feature is available on the
25631  SPI module.
25632  When this function returns true, these functions are supported on the device:
25633  - PLIB_SPI_PinEnable
25634  - PLIB_SPI_PinDisable
25635  This operation is atomic.
25636  Preconditions:
25637  None.
25638  Parameters:
25639  index - Identifier for the device instance
25640  Returns:
25641  - true - The PinControl feature is supported on the device
25642  - false - The PinControl feature is not supported on the device
25643  Remarks:
25644  None.
25645 */
25646 
25647 bool
25649  SPI_MODULE_ID index ) ;
25650 //******************************************************************************
25651 /* Function:
25652  PLIB_SPI_ExistsCommunicationWidth( SPI_MODULE_ID index )
25653  Summary:
25654  Identifies whether the CommunicationWidth feature exists on the SPI module.
25655  Description:
25656  This function identifies whether the CommunicationWidth feature is available
25657  on the SPI module.
25658  When this function returns true, this function is supported on the device:
25659  - PLIB_SPI_CommunicationWidthSelect
25660  This operation is atomic.
25661  Preconditions:
25662  None.
25663  Parameters:
25664  index - Identifier for the device instance
25665  Returns:
25666  - true - The CommunicationWidth feature is supported on the device
25667  - false - The CommunicationWidth feature is not supported on the device
25668  Remarks:
25669  None.
25670 */
25671 
25672 bool
25674  SPI_MODULE_ID index ) ;
25675 //******************************************************************************
25676 /* Function:
25677  PLIB_SPI_ExistsAudioCommunicationWidth( SPI_MODULE_ID index )
25678  Summary:
25679  Identifies whether the AudioCommunicationWidth feature exists on the SPI module.
25680  Description:
25681  This function identifies whether the AudioCommunicationWidth feature is available
25682  on the SPI module.
25683  When this function returns true, this function is supported on the device:
25684  - PLIB_SPI_AudioCommunicationWidthSelect
25685  This operation is atomic.
25686  Preconditions:
25687  None.
25688  Parameters:
25689  index - Identifier for the device instance
25690  Returns:
25691  - true - The AudioCommunicationWidth feature is supported on the device
25692  - false - The AudioCommunicationWidth feature is not supported on the device
25693  Remarks:
25694  None.
25695 */
25696 
25697 bool
25699  SPI_MODULE_ID index ) ;
25700 //******************************************************************************
25701 /* Function:
25702  PLIB_SPI_ExistsInputSamplePhase( SPI_MODULE_ID index )
25703  Summary:
25704  Identifies whether the InputSamplePhase feature exists on the SPI module.
25705  Description:
25706  This function identifies whether the InputSamplePhase feature is available
25707  on the SPI module.
25708  When this function returns true, this function is supported on the device:
25709  - PLIB_SPI_InputSamplePhaseSelect
25710  This operation is atomic.
25711  Preconditions:
25712  None.
25713  Parameters:
25714  index - Identifier for the device instance
25715  Returns:
25716  - true - The InputSamplePhase feature is supported on the device
25717  - false - The InputSamplePhase feature is not supported on the device
25718  Remarks:
25719  None.
25720 */
25721 
25722 bool
25724  SPI_MODULE_ID index ) ;
25725 //******************************************************************************
25726 /* Function:
25727  PLIB_SPI_ExistsOutputDataPhase( SPI_MODULE_ID index )
25728  Summary:
25729  Identifies whether the OutputDataPhase feature exists on the SPI module.
25730  Description:
25731  This function identifies whether the OutputDataPhase feature is available on
25732  the SPI module.
25733  When this function returns true, this function is supported on the device:
25734  - PLIB_SPI_OutputDataPhaseSelect
25735  This operation is atomic.
25736  Preconditions:
25737  None.
25738  Parameters:
25739  index - Identifier for the device instance
25740  Returns:
25741  - true - The OutputDataPhase feature is supported on the device
25742  - false - The OutputDataPhase feature is not supported on the device
25743  Remarks:
25744  None.
25745 */
25746 
25747 bool
25749  SPI_MODULE_ID index ) ;
25750 //******************************************************************************
25751 /* Function:
25752  PLIB_SPI_ExistsClockPolarity( SPI_MODULE_ID index )
25753  Summary:
25754  Identifies whether the ClockPolarity feature exists on the SPI module.
25755  Description:
25756  This function identifies whether the ClockPolarity feature is available on
25757  the SPI module.
25758  When this function returns true, this function is supported on the device:
25759  - PLIB_SPI_ClockPolaritySelect
25760  This operation is atomic.
25761  Preconditions:
25762  None.
25763  Parameters:
25764  index - Identifier for the device instance
25765  Returns:
25766  - true - The ClockPolarity feature is supported on the device
25767  - false - The ClockPolarity feature is not supported on the device
25768  Remarks:
25769  None.
25770 */
25771 
25772 bool
25774  SPI_MODULE_ID index ) ;
25775 //******************************************************************************
25776 /* Function:
25777  PLIB_SPI_ExistsMasterControl( SPI_MODULE_ID index )
25778  Summary:
25779  Identifies whether the MasterControl feature exists on the SPI module.
25780  Description:
25781  This function identifies whether the MasterControl feature is available on
25782  the SPI module.
25783  When this function returns true, these functions are supported on the device:
25784  - PLIB_SPI_MasterEnable
25785  - PLIB_SPI_SlaveEnable
25786  This operation is atomic.
25787  Preconditions:
25788  None.
25789  Parameters:
25790  index - Identifier for the device instance
25791  Returns:
25792  - true - The MasterControl feature is supported on the device
25793  - false - The MasterControl feature is not supported on the device
25794  Remarks:
25795  None.
25796 */
25797 
25798 bool
25800  SPI_MODULE_ID index ) ;
25801 //******************************************************************************
25802 /* Function:
25803  PLIB_SPI_ExistsBaudRate( SPI_MODULE_ID index )
25804  Summary:
25805  Identifies whether the BaudRate feature exists on the SPI module.
25806  Description:
25807  This function identifies whether the BaudRate feature is available on the SPI
25808  module.
25809  When this function returns true, this function is supported on the device:
25810  - PLIB_SPI_BaudRateSet
25811  This operation is atomic.
25812  Preconditions:
25813  None.
25814  Parameters:
25815  index - Identifier for the device instance
25816  Returns:
25817  - true - The BaudRate feature is supported on the device
25818  - false - The BaudRate feature is not supported on the device
25819  Remarks:
25820  None.
25821 */
25822 
25823 bool
25825  SPI_MODULE_ID index ) ;
25826 //******************************************************************************
25827 /* Function:
25828  PLIB_SPI_ExistsBusStatus( SPI_MODULE_ID index )
25829  Summary:
25830  Identifies whether the BusStatus feature exists on the SPI module.
25831  Description:
25832  This function identifies whether the BusStatus feature is available on the
25833  SPI module.
25834  When this function returns true, this function is supported on the device:
25835  - PLIB_SPI_IsBusy
25836  This operation is atomic.
25837  Preconditions:
25838  None.
25839  Parameters:
25840  index - Identifier for the device instance
25841  Returns:
25842  - true - The BusStatus feature is supported on the device
25843  - false - The BusStatus feature is not supported on the device
25844  Remarks:
25845  None.
25846 */
25847 
25848 bool
25850  SPI_MODULE_ID index ) ;
25851 //******************************************************************************
25852 /* Function:
25853  PLIB_SPI_ExistsReadDataSignStatus( SPI_MODULE_ID index )
25854  Summary:
25855  Identifies whether the ReadDataSignStatus feature exists on the SPI module.
25856  Description:
25857  This function identifies whether the ReadDataSignStatus feature is available
25858  on the SPI module.
25859  When this function returns true, this function is supported on the device:
25860  - PLIB_SPI_ReadDataIsSignExtended
25861  This operation is atomic.
25862  Preconditions:
25863  None.
25864  Parameters:
25865  index - Identifier for the device instance
25866  Returns:
25867  - true - The ReadDataSignStatus feature is supported on the device
25868  - false - The ReadDataSignStatus feature is not supported on the device
25869  Remarks:
25870  None.
25871 */
25872 
25873 bool
25875  SPI_MODULE_ID index ) ;
25876 //******************************************************************************
25877 /* Function:
25878  PLIB_SPI_ExistsSlaveSelectControl( SPI_MODULE_ID index )
25879  Summary:
25880  Identifies whether the SlaveSelectControl feature exists on the SPI module.
25881  Description:
25882  This function identifies whether the SlaveSelectControl feature is available
25883  on the SPI module.
25884  When this function returns true, these functions are supported on the device:
25885  - PLIB_SPI_SlaveSelectEnable
25886  - PLIB_SPI_SlaveSelectDisable
25887  This operation is atomic.
25888  Preconditions:
25889  None.
25890  Parameters:
25891  index - Identifier for the device instance
25892  Returns:
25893  - true - The SlaveSelectControl feature is supported on the device
25894  - false - The SlaveSelectControl feature is not supported on the device
25895  Remarks:
25896  None.
25897 */
25898 
25899 bool
25901  SPI_MODULE_ID index ) ;
25902 //******************************************************************************
25903 /* Function:
25904  PLIB_SPI_ExistsTransmitUnderRunStatus( SPI_MODULE_ID index )
25905  Summary:
25906  Identifies whether the TransmitUnderRunStatus feature exists on the SPI module.
25907  Description:
25908  This function identifies whether the TransmitUnderRunStatus feature is available
25909  on the SPI module.
25910  When this function returns true, these functions are supported on the device:
25911  - PLIB_SPI_TransmitUnderRunStatusGet
25912  - PLIB_SPI_TransmitUnderRunStatusClear
25913  This operation is atomic.
25914  Preconditions:
25915  None.
25916  Parameters:
25917  index - Identifier for the device instance
25918  Returns:
25919  - true - The TransmitUnderRunStatus feature is supported on the device
25920  - false - The TransmitUnderRunStatus feature is not supported on the device
25921  Remarks:
25922  None.
25923 */
25924 
25925 bool
25927  SPI_MODULE_ID index ) ;
25928 //******************************************************************************
25929 /* Function:
25930  PLIB_SPI_ExistsFIFOControl( SPI_MODULE_ID index )
25931  Summary:
25932  Identifies whether the FIFOControl feature exists on the SPI module.
25933  Description:
25934  This function identifies whether the FIFOControl feature is available on the
25935  SPI module.
25936  When this function returns true, these functions are supported on the device:
25937  - PLIB_SPI_FIFOEnable
25938  - PLIB_SPI_FIFODisable
25939  This operation is atomic.
25940  Preconditions:
25941  None.
25942  Parameters:
25943  index - Identifier for the device instance
25944  Returns:
25945  - true - The FIFOControl feature is supported on the device
25946  - false - The FIFOControl feature is not supported on the device
25947  Remarks:
25948  None.
25949 */
25950 
25951 bool
25953  SPI_MODULE_ID index ) ;
25954 //******************************************************************************
25955 /* Function:
25956  PLIB_SPI_ExistsFIFOCount( SPI_MODULE_ID index )
25957  Summary:
25958  Identifies whether the FIFOCount feature exists on the SPI module.
25959  Description:
25960  This function identifies whether the FIFOCount feature is available on the SPI module.
25961  When this function returns true, this function is supported on the device:
25962  - PLIB_SPI_FIFOCountGet
25963  This operation is atomic.
25964  Preconditions:
25965  None.
25966  Parameters:
25967  index - Identifier for the device instance
25968  Returns:
25969  - true - The FIFOCount feature is supported on the device
25970  - false - The FIFOCount feature is not supported on the device
25971  Remarks:
25972  None.
25973 */
25974 
25975 bool
25977  SPI_MODULE_ID index ) ;
25978 //******************************************************************************
25979 /* Function:
25980  PLIB_SPI_ExistsReceiveFIFOStatus( SPI_MODULE_ID index )
25981  Summary:
25982  Identifies whether the ReceiveFIFOStatus feature exists on the SPI module.
25983  Description:
25984  This function identifies whether the ReceiveFIFOStatus feature is available
25985  on the SPI module.
25986  When this function returns true, this function is supported on the device:
25987  - PLIB_SPI_ReceiverFIFOIsEmpty
25988  This operation is atomic.
25989  Preconditions:
25990  None.
25991  Parameters:
25992  index - Identifier for the device instance
25993  Returns:
25994  - true - The ReceiveFIFOStatus feature is supported on the device
25995  - false - The ReceiveFIFOStatus feature is not supported on the device
25996  Remarks:
25997  None.
25998 */
25999 
26000 bool
26002  SPI_MODULE_ID index ) ;
26003 //******************************************************************************
26004 /* Function:
26005  PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus( SPI_MODULE_ID index )
26006  Summary:
26007  Identifies whether the FIFOShiftRegisterEmptyStatus feature exists on the SPI module.
26008  Description:
26009  This function identifies whether the FIFOShiftRegisterEmptyStatus feature is
26010  available on the SPI module.
26011  When this function returns true, this function is supported on the device:
26012  - PLIB_SPI_FIFOShiftRegisterIsEmpty
26013  This operation is atomic.
26014  Preconditions:
26015  None.
26016  Parameters:
26017  index - Identifier for the device instance
26018  Returns:
26019  - true - The FIFOShiftRegisterEmptyStatus feature is supported on the device
26020  - false - The FIFOShiftRegisterEmptyStatus feature is not supported on the device
26021  Remarks:
26022  None.
26023 */
26024 
26025 bool
26027  SPI_MODULE_ID index ) ;
26028 //******************************************************************************
26029 /* Function:
26030  PLIB_SPI_ExistsFIFOInterruptMode( SPI_MODULE_ID index )
26031  Summary:
26032  Identifies whether the FIFOInterruptMode feature exists on the SPI module.
26033  Description:
26034  This function identifies whether the FIFOInterruptMode feature is available
26035  on the SPI module.
26036  When this function returns true, this function is supported on the device:
26037  - PLIB_SPI_FIFOInterruptModeSelect
26038  This operation is atomic.
26039  Preconditions:
26040  None.
26041  Parameters:
26042  index - Identifier for the device instance
26043  Returns:
26044  - true - The FIFOInterruptMode feature is supported on the device
26045  - false - The FIFOInterruptMode feature is not supported on the device
26046  Remarks:
26047  None.
26048 */
26049 
26050 bool
26052  SPI_MODULE_ID index ) ;
26053 //******************************************************************************
26054 /* Function:
26055  PLIB_SPI_ExistsFramedCommunication( SPI_MODULE_ID index )
26056  Summary:
26057  Identifies whether the FramedCommunication feature exists on the SPI module.
26058  Description:
26059  This function identifies whether the FramedCommunication feature is available
26060  on the SPI module.
26061  When this function returns true, these functions are supported on the device:
26062  - PLIB_SPI_FramedCommunicationEnable
26063  - PLIB_SPI_FramedCommunicationDisable
26064  This operation is atomic.
26065  Preconditions:
26066  None.
26067  Parameters:
26068  index - Identifier for the device instance
26069  Returns:
26070  - true - The FramedCommunication feature is supported on the device
26071  - false - The FramedCommunication feature is not supported on the device
26072  Remarks:
26073  None.
26074 */
26075 
26076 bool
26078  SPI_MODULE_ID index ) ;
26079 //******************************************************************************
26080 /* Function:
26081  PLIB_SPI_ExistsFrameSyncPulseDirection( SPI_MODULE_ID index )
26082  Summary:
26083  Identifies whether the FrameSyncPulseDirection feature exists on the SPI module.
26084  Description:
26085  This function identifies whether the FrameSyncPulseDirection feature is available
26086  on the SPI module.
26087  When this function returns true, this function is supported on the device:
26088  - PLIB_SPI_FrameSyncPulseDirectionSelect
26089  This operation is atomic.
26090  Preconditions:
26091  None.
26092  Parameters:
26093  index - Identifier for the device instance
26094  Returns:
26095  - true - The FrameSyncPulseDirection feature is supported on the device
26096  - false - The FrameSyncPulseDirection feature is not supported on the device
26097  Remarks:
26098  None.
26099 */
26100 
26101 bool
26103  SPI_MODULE_ID index ) ;
26104 //******************************************************************************
26105 /* Function:
26106  PLIB_SPI_ExistsFrameSyncPulsePolarity( SPI_MODULE_ID index )
26107  Summary:
26108  Identifies whether the FrameSyncPulsePolarity feature exists on the SPI module.
26109  Description:
26110  This function identifies whether the FrameSyncPulsePolarity feature is available
26111  on the SPI module.
26112  When this function returns true, this function is supported on the device:
26113  - PLIB_SPI_FrameSyncPulsePolaritySelect
26114  This operation is atomic.
26115  Preconditions:
26116  None.
26117  Parameters:
26118  index - Identifier for the device instance
26119  Returns:
26120  - true - The FrameSyncPulsePolarity feature is supported on the device
26121  - false - The FrameSyncPulsePolarity feature is not supported on the device
26122  Remarks:
26123  None.
26124 */
26125 
26126 bool
26128  SPI_MODULE_ID index ) ;
26129 //******************************************************************************
26130 /* Function:
26131  PLIB_SPI_ExistsFrameSyncPulseEdge( SPI_MODULE_ID index )
26132  Summary:
26133  Identifies whether the FrameSyncPulseEdge feature exists on the SPI module.
26134  Description:
26135  This function identifies whether the FrameSyncPulseEdge feature is available
26136  on the SPI module.
26137  When this function returns true, this function is supported on the device:
26138  - PLIB_SPI_FrameSyncPulseEdgeSelect
26139  This operation is atomic.
26140  Preconditions:
26141  None.
26142  Parameters:
26143  index - Identifier for the device instance
26144  Returns:
26145  - true - The FrameSyncPulseEdge feature is supported on the device
26146  - false - The FrameSyncPulseEdge feature is not supported on the device
26147  Remarks:
26148  None.
26149 */
26150 
26151 bool
26153  SPI_MODULE_ID index ) ;
26154 //******************************************************************************
26155 /* Function:
26156  PLIB_SPI_ExistsFrameSyncPulseWidth( SPI_MODULE_ID index )
26157  Summary:
26158  Identifies whether the FrameSyncPulseWidth feature exists on the SPI module.
26159  Description:
26160  This function identifies whether the FrameSyncPulseWidth feature is available
26161  on the SPI module.
26162  When this function returns true, this function is supported on the device:
26163  - PLIB_SPI_FrameSyncPulseWidthSelect
26164  This operation is atomic.
26165  Preconditions:
26166  None.
26167  Parameters:
26168  index - Identifier for the device instance
26169  Returns:
26170  - true - The FrameSyncPulseWidth feature is supported on the device
26171  - false - The FrameSyncPulseWidth feature is not supported on the device
26172  Remarks:
26173  None.
26174 */
26175 
26176 bool
26178  SPI_MODULE_ID index ) ;
26179 //******************************************************************************
26180 /* Function:
26181  PLIB_SPI_ExistsFrameSyncPulseCounter( SPI_MODULE_ID index )
26182  Summary:
26183  Identifies whether the FrameSyncPulseCounter feature exists on the SPI module.
26184  Description:
26185  This function identifies whether the FrameSyncPulseCounter feature is available
26186  on the SPI module.
26187  When this function returns true, this function is supported on the device:
26188  - PLIB_SPI_FrameSyncPulseCounterSelect
26189  This operation is atomic.
26190  Preconditions:
26191  None.
26192  Parameters:
26193  index - Identifier for the device instance
26194  Returns:
26195  - true - The FrameSyncPulseCounter feature is supported on the device
26196  - false - The FrameSyncPulseCounter feature is not supported on the device
26197  Remarks:
26198  None.
26199 */
26200 
26201 bool
26203  SPI_MODULE_ID index ) ;
26204 //******************************************************************************
26205 /* Function:
26206  PLIB_SPI_ExistsFrameErrorStatus( SPI_MODULE_ID index )
26207  Summary:
26208  Identifies whether the FrameErrorStatus feature exists on the SPI module.
26209  Description:
26210  This function identifies whether the FrameErrorStatus feature is available on
26211  the SPI module.
26212  When this function returns true, these functions are supported on the device:
26213  - PLIB_SPI_FrameErrorStatusGet
26214  - PLIB_SPI_FrameErrorStatusClear
26215  This operation is atomic.
26216  Preconditions:
26217  None.
26218  Parameters:
26219  index - Identifier for the device instance
26220  Returns:
26221  - true - The FrameErrorStatus feature is supported on the device
26222  - false - The FrameErrorStatus feature is not supported on the device
26223  Remarks:
26224  None.
26225 */
26226 
26227 bool
26229  SPI_MODULE_ID index ) ;
26230 //******************************************************************************
26231 /* Function:
26232  PLIB_SPI_ExistsBuffer( SPI_MODULE_ID index )
26233  Summary:
26234  Identifies whether the Buffer feature exists on the SPI module.
26235  Description:
26236  This function identifies whether the Buffer feature is available on the SPI module.
26237  When this function returns true, these functions are supported on the device:
26238  - PLIB_SPI_BufferClear
26239  - PLIB_SPI_BufferRead
26240  - PLIB_SPI_BufferWrite
26241  - PLIB_SPI_BufferAddressGet
26242  This operation is atomic.
26243  Preconditions:
26244  None.
26245  Parameters:
26246  index - Identifier for the device instance
26247  Returns:
26248  - true - The Buffer feature is supported on the device
26249  - false - The Buffer feature is not supported on the device
26250  Remarks:
26251  None.
26252 */
26253 
26254 bool
26256  SPI_MODULE_ID index ) ;
26257 //******************************************************************************
26258 /* Function:
26259  PLIB_SPI_ExistsBaudRateClock( SPI_MODULE_ID index )
26260  Summary:
26261  Identifies whether the BaudRateClock feature exists on the SPI module.
26262  Description:
26263  This function identifies whether the BaudRateClock feature is available on
26264  the SPI module.
26265  When this function returns true, this function is supported on the device:
26266  - PLIB_SPI_BaudRateClockSelect
26267  This operation is atomic.
26268  Preconditions:
26269  None.
26270  Parameters:
26271  index - Identifier for the device instance
26272  Returns:
26273  - true - The BaudRateClock feature is supported on the device
26274  - false - The BaudRateClock feature is not supported on the device
26275  Remarks:
26276  None.
26277 */
26278 
26279 bool
26281  SPI_MODULE_ID index ) ;
26282 //******************************************************************************
26283 /* Function:
26284  PLIB_SPI_ExistsErrorInterruptControl( SPI_MODULE_ID index )
26285  Summary:
26286  Identifies whether the ErrorInterruptControl feature exists on the SPI module.
26287  Description:
26288  This function identifies whether the ErrorInterruptControl feature is available
26289  on the SPI module.
26290  When this function returns true, these functions are supported on the device:
26291  - PLIB_SPI_ErrorInterruptEnable
26292  - PLIB_SPI_ErrorInterruptDisable
26293  This operation is atomic.
26294  Preconditions:
26295  None.
26296  Parameters:
26297  index - Identifier for the device instance
26298  Returns:
26299  - true - The ErrorInterruptControl feature is supported on the device
26300  - false - The ErrorInterruptControl feature is not supported on the device
26301  Remarks:
26302  None.
26303 */
26304 
26305 bool
26307  SPI_MODULE_ID index ) ;
26308 //******************************************************************************
26309 /* Function:
26310  PLIB_SPI_ExistsAudioErrorControl( SPI_MODULE_ID index )
26311  Summary:
26312  Identifies whether the AudioErrorControl feature exists on the SPI module.
26313  Description:
26314  This function identifies whether the AudioErrorControl feature is available
26315  on the SPI module.
26316  When this function returns true, these functions are supported on the device:
26317  - PLIB_SPI_AudioErrorEnable
26318  - PLIB_SPI_AudioErrorDisable
26319  This operation is atomic.
26320  Preconditions:
26321  None.
26322  Parameters:
26323  index - Identifier for the device instance
26324  Returns:
26325  - true - The AudioErrorControl feature is supported on the device
26326  - false - The AudioErrorControl feature is not supported on the device
26327  Remarks:
26328  None.
26329 */
26330 
26331 bool
26333  SPI_MODULE_ID index ) ;
26334 //******************************************************************************
26335 /* Function:
26336  PLIB_SPI_ExistsAudioProtocolControl( SPI_MODULE_ID index )
26337  Summary:
26338  Identifies whether the AudioProtocolControl feature exists on the SPI module.
26339  Description:
26340  This function identifies whether the AudioProtocolControl feature is available
26341  on the SPI module.
26342  When this function returns true, this function is supported on the device:
26343  - PLIB_SPI_AudioProtocolEnable
26344  - PLIB_SPI_AudioProtocolDisable
26345  This operation is atomic.
26346  Preconditions:
26347  None.
26348  Parameters:
26349  index - Identifier for the device instance
26350  Returns:
26351  - true - The AudioProtocolControl feature is supported on the device
26352  - false - The AudioProtocolControl feature is not supported on the device
26353  Remarks:
26354  None.
26355 */
26356 
26357 bool
26359  SPI_MODULE_ID index ) ;
26360 //******************************************************************************
26361 /* Function:
26362  PLIB_SPI_ExistsAudioTransmitMode( SPI_MODULE_ID index )
26363  Summary:
26364  Identifies whether the AudioTransmitMode feature exists on the SPI module.
26365  Description:
26366  This function identifies whether the AudioTransmitMode feature is available
26367  on the SPI module.
26368  When this function returns true, this function is supported on the device:
26369  - PLIB_SPI_AudioTransmitModeSelect
26370  This operation is atomic.
26371  Preconditions:
26372  None.
26373  Parameters:
26374  index - Identifier for the device instance
26375  Returns:
26376  - true - The AudioTransmitMode feature is supported on the device
26377  - false - The AudioTransmitMode feature is not supported on the device
26378  Remarks:
26379  None.
26380 */
26381 
26382 bool
26384  SPI_MODULE_ID index ) ;
26385 //******************************************************************************
26386 /* Function:
26387  PLIB_SPI_ExistsAudioProtocolMode( SPI_MODULE_ID index )
26388  Summary:
26389  Identifies whether the AudioProtocolMode feature exists on the SPI module.
26390  Description:
26391  This function identifies whether the AudioProtocolMode feature is available
26392  on the SPI module.
26393  When this function returns true, this function is supported on the device:
26394  - PLIB_SPI_AudioProtocolModeSelect
26395  This operation is atomic.
26396  Preconditions:
26397  None.
26398  Parameters:
26399  index - Identifier for the device instance
26400  Returns:
26401  - true - The AudioProtocolMode feature is supported on the device
26402  - false - The AudioProtocolMode feature is not supported on the device
26403  Remarks:
26404  None.
26405 */
26406 
26407 bool
26409  SPI_MODULE_ID index ) ;
26410 //******************************************************************************
26411 /* Function:
26412  PLIB_SPI_Exists32bitBuffer( SPI_MODULE_ID index )
26413  Summary:
26414  Identifies whether the Buffer32bit feature exists on the SPI module.
26415  Description:
26416  This function identifies whether the Buffer32bit feature is available on the
26417  SPI module.
26418  When this function returns true, these functions are supported on the device:
26419  - PLIB_SPI_BufferRead32bit
26420  - PLIB_SPI_BufferWrite32bit
26421  This operation is atomic.
26422  Preconditions:
26423  None.
26424  Parameters:
26425  index - Identifier for the device instance
26426  Returns:
26427  - true - The Buffer32bit feature is supported on the device
26428  - false - The Buffer32bit feature is not supported on the device
26429  Remarks:
26430  None.
26431 */
26432 
26433 bool
26435  SPI_MODULE_ID index ) ;
26436 //******************************************************************************
26437 /* Function:
26438  PLIB_SPI_Exists16bitBuffer( SPI_MODULE_ID index )
26439  Summary:
26440  Identifies whether the Buffer16bit feature exists on the SPI module.
26441  Description:
26442  This function identifies whether the Buffer16bit feature is available on the
26443  SPI module.
26444  When this function returns true, these functions are supported on the device:
26445  - PLIB_SPI_BufferRead16bit
26446  - PLIB_SPI_BufferWrite16bit
26447  This operation is atomic.
26448  Preconditions:
26449  None.
26450  Parameters:
26451  index - Identifier for the device instance
26452  Returns:
26453  - true - The Buffer16bit feature is supported on the device
26454  - false - The Buffer16bit feature is not supported on the device
26455  Remarks:
26456  None.
26457 */
26458 
26459 bool
26461  SPI_MODULE_ID index ) ;
26462 //DOM-IGNORE-BEGIN
26463 //DOM-IGNORE-END
26464  // #ifndef _PLIB_SPI_H
26465 /*******************************************************************************
26466  End of File
26467  */
26468 
26469 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h*/
26470 /* CLOSE_FILE Include File */
26471 
26472  // SPI PLIB Header
26473 #include "system/common/sys_common.h" // Common System Service Definitions
26474 #include "system/common/sys_module.h" // Module/Driver Definitions
26475 #include "system/int/sys_int.h" // System Interrupt Definitions
26476 #include "system/clk/sys_clk.h"
26477 #include "C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h"
26478  /* LDRA full path */
26479 // DOM-IGNORE-BEGIN
26480 // DOM-IGNORE-END
26481 // *****************************************************************************
26482 /* SPI Driver Buffer Handle
26483  Summary:
26484  Handle identifying a read or write buffer passed to the driver.
26485  Description:
26486  A buffer handle value is returned by a call to the DRV_SPI_BufferAddRead()/
26487  DRV_SPI_BufferAddWrite or DRV_SPI_BufferAddReadWrite() functions.
26488  This handle is associated with the buffer passed into the function and
26489  it allows the application to track the completion of the data from (or into)
26490  that buffer. The buffer handle value returned from the "buffer add" function
26491  is returned back to the client by the "callback" function registered with
26492  the driver.
26493  The buffer handle assigned to a client request expires when the client has
26494  been notified of the completion of the buffer transfer (after event handler
26495  function that notifies the client returns) or after the buffer has been
26496  retired by the driver if no event handler callback was set.
26497  Remarks:
26498  None.
26499 */
26500 
26501 typedef
26502 uintptr_t
26504 // *****************************************************************************
26505 /* SPI Driver Invalid Buffer Handle
26506  Summary:
26507  Definition of an invalid buffer handle.
26508  Description:
26509  This is the definition of an invalid buffer handle. An invalid buffer handle
26510  is returned by DRV_SPI_BufferAddRead() and DRV_SPI_BufferAddWrite()
26511  function if the buffer add request was not successful.
26512  Remarks:
26513  None.
26514 */
26515 #define DRV_SPI_BUFFER_HANDLE_INVALID ( ( DRV_SPI_BUFFER_HANDLE ) ( - 1 ) )
26516 // *****************************************************************************
26517 /* SPI Driver Module Index Numbers
26518  Summary:
26519  SPI driver index definitions.
26520  Description:
26521  These constants provide the SPI driver index definitions.
26522  Remarks:
26523  These constants should be used in place of hard-coded numeric literals.
26524  These values should be passed into the DRV_SPI_Initialize and
26525  DRV_SPI_Open functions to identify the driver instance in use.
26526 */
26527 #define DRV_SPI_INDEX_0 0
26528 #define DRV_SPI_INDEX_1 1
26529 #define DRV_SPI_INDEX_2 2
26530 #define DRV_SPI_INDEX_3 3
26531 #define DRV_SPI_INDEX_4 4
26532 #define DRV_SPI_INDEX_5 5
26533 // *****************************************************************************
26534 /* SPI Driver Module Index Count
26535  Summary:
26536  Number of valid SPI driver indices.
26537  Description:
26538  This constant identifies the number of valid SPI driver indices.
26539  Remarks:
26540  This constant should be used in place of hard-coded numeric literals.
26541  This value is derived from device-specific header files defined as part
26542  of the peripheral libraries.
26543 */
26544 #define DRV_SPI_INDEX_COUNT SPI_NUMBER_OF_MODULES
26545 // *****************************************************************************
26546 /* SPI Clock Mode Selection
26547  Summary:
26548  Identifies the various clock modes of the SPI module.
26549  Description:
26550  This enumeration identifies the various clock modes of the SPI module.
26551  Remarks:
26552  None.
26553 */
26554 
26555 typedef
26556  enum
26557  {
26558  /* SPI Clock Mode 0:
26559  - Idle State of the clock is Low
26560  - Serial Output Data (SDO) Changed on Rising Edge of the clock
26561  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26563  /*DOM-IGNORE-BEGIN*/
26564  = 0 /*DOM-IGNORE-END*/
26565  ,
26566  /* SPI Clock Mode 1:
26567  - Idle State of the clock is Low
26568  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26569  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26571  /*DOM-IGNORE-BEGIN*/
26572  = 1 /*DOM-IGNORE-END*/
26573  ,
26574  /* SPI Clock Mode 2:
26575  - Idle State of the clock is High
26576  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26577  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26579  /*DOM-IGNORE-BEGIN*/
26580  = 2 /*DOM-IGNORE-END*/
26581  ,
26582  /* SPI Clock Mode 3:
26583  - Idle State of the clock is High
26584  - Serial Output Data (SDO) Changes on Rising Edge of the clock
26585  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26587  /*DOM-IGNORE-BEGIN*/
26588  = 3 /*DOM-IGNORE-END*/
26589  } DRV_SPI_CLOCK_MODE ;
26590 // *****************************************************************************
26591 /* SPI Buffer Type Selection
26592  Summary:
26593  Identifies the various buffer types of the SPI module.
26594  Description:
26595  This enumeration identifies the various buffer types of the SPI module.
26596  Remarks:
26597  None.
26598 */
26599 
26600 typedef
26601  enum
26602  {
26603  /* SPI Buffer Type Standard */
26605  /*DOM-IGNORE-BEGIN*/
26606  = 0 /*DOM-IGNORE-END*/
26607  ,
26608  /* SPI Enhanced Buffer Type */
26610  /*DOM-IGNORE-BEGIN*/
26611  = 1 /*DOM-IGNORE-END*/
26613 // *****************************************************************************
26614 /* SPI Protocols Enumeration
26615  Summary:
26616  Identifies the various protocols of the SPI module.
26617  Description:
26618  This enumeration identifies the various protocols of the SPI module.
26619  Remarks:
26620  None.
26621 */
26622 
26623 typedef
26624  enum
26625  {
26626  /* SPI Protocol Type Standard */
26628  /*DOM-IGNORE-BEGIN*/
26629  = 0 /*DOM-IGNORE-END*/
26630  ,
26631  /* SPI Protocol Type Framed */
26633  /*DOM-IGNORE-BEGIN*/
26634  = 1 /*DOM-IGNORE-END*/
26635  ,
26636  /*SPI Protocol Type Audio*/
26638  /*DOM-IGNORE-BEGIN*/
26639  = 2 /*DOM-IGNORE-END*/
26641 // *****************************************************************************
26642 /* SPI Driver Buffer Events
26643  Summary
26644  Identifies the possible events that can result from a buffer add request.
26645  Description
26646  This enumeration identifies the possible events that can result from a
26647  buffer add request caused by the client calling either
26648  DRV_SPI_BufferAddRead2 or DRV_SPI_BufferAddWrite2 or similar functions.
26649  Remarks:
26650  One of these values is passed in the "event" parameter of the event
26651  handling callback function that the client registered during buffer add
26652  requests.
26653 */
26654 
26655 typedef
26656  enum
26657  {
26658  /* Buffer is pending to get processed */
26660  /* Buffer is being processed */
26662  /* All data from or to the buffer was transferred successfully. */
26664  /* There was an error while processing the buffer transfer request. */
26667 // *****************************************************************************
26668 /* SPI Usage Modes Enumeration
26669  Summary:
26670  Identifies the various usage modes of the SPI module.
26671  Description:
26672  This enumeration identifies the various usage modes of the SPI module.
26673  Remarks:
26674  None.
26675 */
26676 
26677 typedef
26678  enum
26679  {
26680  /* SPI Mode Master */
26682  /*DOM-IGNORE-BEGIN*/
26683  = 0 /*DOM-IGNORE-END*/
26684  ,
26685  /* SPI Mode Slave */
26687  /*DOM-IGNORE-BEGIN*/
26688  = 1 /*DOM-IGNORE-END*/
26689  } DRV_SPI_MODE ;
26690 // *****************************************************************************
26691 /* SPI Task Modes Enumeration
26692  Summary:
26693  Identifies the various modes of how the tasks function will be run.
26694  Description:
26695  This enumeration identifies the various tasks mode
26696  Remarks:
26697  None.
26698 */
26699 
26700 typedef
26701  enum
26702  {
26703  /* Task is configured to run in polled mode */
26705  /*DOM-IGNORE-BEGIN*/
26706  = 0 /*DOM-IGNORE-END*/
26707  ,
26708  /* Task is configured to run in interrupt mode */
26710  /*DOM-IGNORE-BEGIN*/
26711  = 1 /*DOM-IGNORE-END*/
26712  } DRV_SPI_TASK_MODE ;
26713 // *****************************************************************************
26714 /* SPI Driver Buffer Event Handler Function Pointer
26715  Summary:
26716  Pointer to a SPI Driver Buffer Event handler function
26717  Description:
26718  This data type defines the required function signature for the SPI driver
26719  buffer event handling callback function. A client must register a pointer
26720  to a buffer event handling function who's function signature (parameter
26721  and return value types) match the types specified by this function pointer
26722  in order to receive buffer related event calls back from the driver.
26723  The parameters and return values and return value are described here and
26724  a partial example implementation is provided.
26725  Parameters:
26726  event - Identifies the type of event
26727  bufferHandle - Handle identifying the buffer to which the vent relates
26728  context - Value identifying the context of the application that
26729  registered the event handling function.
26730  Returns:
26731  None.
26732  Example:
26733  <code>
26734  void APP_MyBufferEventHandler( DRV_SPI_BUFFER_EVENT event,
26735  DRV_SPI_BUFFER_HANDLE bufferHandle,
26736  uintptr_t context )
26737  {
26738  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
26739  switch(event)
26740  {
26741  case DRV_SPI_BUFFER_EVENT_COMPLETE:
26742  // Handle the completed buffer.
26743  break;
26744  case DRV_SPI_BUFFER_EVENT_ERROR:
26745  default:
26746  // Handle error.
26747  break;
26748  }
26749  }
26750  </code>
26751  Remarks:
26752  If the event is DRV_SPI_BUFFER_EVENT_COMPLETE, it means that the data was
26753  transferred successfully.
26754  If the event is DRV_SPI_BUFFER_EVENT_ERROR, it means that the data was
26755  not transferred successfully.
26756  The bufferHandle parameter contains the buffer handle of the buffer that
26757  failed.
26758  The context parameter contains the a handle to the client context,
26759  provided at the time the event handling function registration.
26760  This context handle value is passed back to the client as the "context"
26761  parameter. It can be any value necessary to identify the client context
26762  or instance (such as a pointer to the client's data) instance of the
26763  client that made the buffer add request.
26764  The event handler function executes in an interrupt context when the driver
26765  is configured for interrupt mode operation. It is recommended of the
26766  application to not perform process intensive operations with in this
26767  function.
26768 */
26769 
26770 typedef
26772 DRV_SPI_BUFFER_HANDLE bufferHandle ,
26773 void * context ) ;
26774 // *****************************************************************************
26775 /* SPI Driver Initialization Data
26776  Summary:
26777  Defines the data required to initialize or reinitialize the SPI driver
26778  Description:
26779  This data type defines the data required to initialize or reinitialize the
26780  SPI driver. If the driver is built statically, the members of this data
26781  structure are statically over-ridden by static override definitions in the
26782  system_config.h file.
26783  Remarks:
26784  None.
26785 */
26786 
26787 typedef
26788 struct _DRV_SPI_INIT
26789 {
26790  /* System module initialization */
26791  SYS_MODULE_INIT moduleInit ;
26792  /* Identifies peripheral (PLIB-level) ID */
26793  SPI_MODULE_ID spiId ;
26794  /* SPI Task Mode Type*/
26796  /* SPI Usage Mode Type */
26798  /* Allow SPI to run when CPU goes to idle mode*/
26799  bool allowIdleRun ;
26800  /* SPI Protocol Type */
26802  /* SPI Slave Mode SSx Pin Select */
26803  bool spiSlaveSSPin ;
26804  /* Framed mode Sync Pulse*/
26805  SPI_FRAME_SYNC_PULSE frameSyncPulse ;
26806  /* Framed Mode pulse polarity*/
26807  SPI_FRAME_PULSE_POLARITY framePulsePolarity ;
26808  /* Framed Mode Pulse Direction*/
26809  SPI_FRAME_PULSE_DIRECTION framePulseDirection ;
26810  /* Framed mode Pulse Edge*/
26811  SPI_FRAME_PULSE_EDGE framePulseEdge ;
26812  /* Framed Mode Pulse width */
26813  SPI_FRAME_PULSE_WIDTH framePulseWidth ;
26814  /* Audio mode transmit mode*/
26815  SPI_AUDIO_TRANSMIT_MODE audioTransmitMode ;
26816  /* Audio mode protocol mode*/
26817  SPI_AUDIO_PROTOCOL audioProtocolMode ;
26818  /* Communication Width */
26819  SPI_COMMUNICATION_WIDTH commWidth ;
26820  /* SPI clock source which generates required baud rate.
26821  It can be either PBCLK or Reference Clock */
26822  SPI_BAUD_RATE_CLOCK baudClockSource ;
26823  /* when Baud rate clock source is peripheral clock, then this element is
26824  used to define which peripheral bus clock is used for this particular
26825  SPI instance. */
26826  CLK_BUSES_PERIPHERAL spiClk ;
26827  /* Baud Rate Value */
26828  uint32_t baudRate ;
26829  /* SPI Buffer Type */
26831  /* SPI Clock mode */
26833  /* SPI Input Sample Phase Selection */
26834  SPI_INPUT_SAMPLING_PHASE inputSamplePhase ;
26835  /* Transmit/Receive or Transmit Interrupt Source for SPI module */
26836  INT_SOURCE txInterruptSource ;
26837  /* Receive Interrupt Source for SPI module */
26838  INT_SOURCE rxInterruptSource ;
26839  /* Error Interrupt Source for SPI module */
26840  INT_SOURCE errInterruptSource ;
26841  /* While using standard buffer and polled mode how many transfers to do
26842  before yielding to other tasks*/
26843  uint8_t numTrfsSmPolled ;
26844  /* Dummy byte value which will be used for dummy transmission */
26845  uint32_t dummyByteValue ;
26846  /* This is the buffer queue size. This is the maximum
26847  number of transfer requests that driver will queue. */
26848  uint8_t queueSize ;
26849  /* This controls the minimum number of jobs that the driver will be able
26850  to accept without running out of memory. The driver will reserve this
26851  number of jobs from the global SPI queue so that it will always be available*/
26852  uint8_t jobQueueReserveSize ;
26853  /* This callback is fired when an operation is about to start on the
26854  SPI bus. This allows the user to set any pins that need to be set.
26855  This callback may be called from an ISR so should not include OSAL
26856  calls. The context parameter is the same one passed into the
26857  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26858  */
26860  /* This callback is fired when an operation has just completed on the
26861  SPI bus. This allows the user to set any pins that need to be set.
26862  This callback may be called from an ISR so should not include OSAL
26863  calls. The context parameter is the same one passed into the
26864  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26865  */
26867 } DRV_SPI_INIT ;
26868 // *****************************************************************************
26869 /* SPI Driver Client Specific Configuration
26870  Summary:
26871  Defines the data that can be changed per client.
26872  Description:
26873  This data type defines the data can be configured per client. This data can
26874  be per client, and overrides the configuration data contained inside of
26875  DRV_SPI_INIT.
26876  Remarks:
26877  None.
26878 */
26879 
26880 typedef
26881 struct _DRV_SPI_CLIENT_DATA
26882 {
26883  /* Baud Rate Value */
26884  uint32_t baudRate ;
26885  /* This callback is fired when an operation is about to start on the
26886  SPI bus. This allows the user to set any pins that need to be set.
26887  This callback may be called from an ISR so should not include OSAL
26888  calls. The context parameter is the same one passed into the
26889  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26890  */
26892  /* This callback is fired when an operation has just completed on the
26893  SPI bus. This allows the user to set any pins that need to be set.
26894  This callback may be called from an ISR so should not include OSAL
26895  calls. The context parameter is the same one passed into the
26896  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26897  */
26900 //DOM-IGNORE-BEGIN
26901 //DOM-IGNORE-END
26902  // #ifndef _DRV_SPI_DEFINITIONS_H
26903 /*******************************************************************************
26904  End of File
26905 */
26906 
26907 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h*/
26908 /* CLOSE_FILE Include File */
26909 
26910 // DOM-IGNORE-BEGIN
26911 // DOM-IGNORE-END
26912 // *****************************************************************************
26913 // *****************************************************************************
26914 // Section: Interface Routines - System Level
26915 // *****************************************************************************
26916 // *****************************************************************************
26917 // *****************************************************************************
26918 /* Function:
26919  SYS_MODULE_OBJ DRV_SPI_Initialize( const SYS_MODULE_INDEX index,
26920  const SYS_MODULE_INIT * const init )
26921  Summary:
26922  Initializes the SPI instance for the specified driver index.
26923  <p><b>Implementation:</b> Static/Dynamic</p>
26924  Description:
26925  This routine initializes the SPI driver instance for the specified driver
26926  index, making it ready for clients to open and use it. The initialization
26927  data is specified by the 'init' parameter. The initialization may fail if the
26928  number of driver objects allocated are insufficient or if the specified
26929  driver instance is already initialized. The driver instance index is
26930  independent of the SPI module ID. For example, driver instance 0 can be
26931  assigned to SPI2. If the driver is built statically, then some of the
26932  initialization parameters are overridden by configuration macros. Refer to
26933  the description of the DRV_SPI_INIT data structure for more details on
26934  which members on this data structure are overridden.
26935  Precondition:
26936  None.
26937  Parameters:
26938  index - Identifier for the instance to be initialized. Please note this
26939  is not the SPI id. The hardware SPI id is set in the initialization
26940  structure. This is the index of the driver index to use.
26941  init - Pointer to a data structure containing any data necessary to
26942  initialize the driver. If this pointer is NULL, the driver
26943  uses the static initialization override macros for each
26944  member of the initialization data structure.
26945  Returns:
26946  - If successful - returns a valid handle to a driver instance object
26947  - If unsuccessful - returns SYS_MODULE_OBJ_INVALID
26948  Example:
26949  <code>
26950  DRV_SPI_INIT init;
26951  SYS_MODULE_OBJ objectHandle;
26952  // Populate the SPI initialization structure
26953  init.spiId = SPI_ID_1,
26954  init.taskMode = DRV_SPI_TASK_MODE_ISR,
26955  init.spiMode = DRV_SPI_MODE_MASTER,
26956  init.allowIdleRun = false,
26957  init.spiProtocolType = DRV_SPI_PROTOCOL_TYPE_STANDARD,
26958  init.commWidth = SPI_COMMUNICATION_WIDTH_8BITS,
26959  init.baudClockSource = SPI_BAUD_RATE_PBCLK_CLOCK;
26960  init.spiClk = CLK_BUS_PERIPHERAL_2,
26961  init.baudRate = 10000000,
26962  init.bufferType = DRV_SPI_BUFFER_TYPE_ENHANCED,
26963  init.clockMode = DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL,
26964  init.inputSamplePhase = SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE,
26965  init.txInterruptSource = INT_SOURCE_SPI_1_TRANSMIT,
26966  init.rxInterruptSource = INT_SOURCE_SPI_1_RECEIVE,
26967  init.errInterruptSource = INT_SOURCE_SPI_1_ERROR,
26968  init.dummyByteValue = 0xFF,
26969  init.queueSize = 10,
26970  init.jobQueueReserveSize = 1,
26971  objectHandle = DRV_SPI_Initialize(DRV_SPI_INDEX_1, (SYS_MODULE_INIT*)usartInitData);
26972  if (SYS_MODULE_OBJ_INVALID == objectHandle)
26973  {
26974  // Handle error
26975  }
26976  </code>
26977  Remarks:
26978  This routine must be called before any other SPI routine is called.
26979  This routine should only be called once during system initialization
26980  unless DRV_SPI_Deinitialize is called to deinitialize the driver
26981  instance. This routine will NEVER block for hardware access.
26982 */
26983 
26984 SYS_MODULE_OBJ
26986  const SYS_MODULE_INDEX index ,
26987  const SYS_MODULE_INIT * const init ) ;
26988 //*************************************************************************
26989 /* Function:
26990  void DRV_SPI_Deinitialize ( SYS_MODULE_OBJ object )
26991  Summary:
26992  Deinitializes the specified instance of the SPI driver module.
26993  <p><b>Implementation:</b> Static/Dynamic</p>
26994  Description:
26995  Deinitializes the specified instance of the SPI driver module,
26996  disabling its operation (and any hardware) and invalidates all of the
26997  internal data.
26998  Precondition:
26999  Function DRV_SPI_Initialize must have been called before calling this
27000  routine and a valid SYS_MODULE_OBJ must have been returned.
27001  Parameters:
27002  object - Driver object handle, returned from DRV_SPI_Initialize
27003  Returns:
27004  None.
27005  Example:
27006  <code>
27007  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
27008  SYS_STATUS status;
27009  DRV_SPI_Deinitialize ( object );
27010  status = DRV_SPI_Status( object );
27011  if( SYS_MODULE_UNINITIALIZED == status )
27012  {
27013  // Check again later if you need to know
27014  // when the driver is deinitialized.
27015  }
27016  </code>
27017  Remarks:
27018  Once the Initialize operation has been called, the De-initialize
27019  operation must be called before the Initialize operation can be called
27020  again.
27021  This function will NEVER block waiting for hardware. If the operation
27022  requires time to allow the hardware to complete, this will be reported
27023  by the DRV_SPI_Status operation. The system has to use DRV_SPI_Status
27024  to find out when the module is in the ready state.
27025 */
27026 
27027 void
27029  SYS_MODULE_OBJ object ) ;
27030 //**************************************************************************
27031 /* Function:
27032  SYS_STATUS DRV_SPI_Status ( SYS_MODULE_OBJ object )
27033  Summary:
27034  Provides the current status of the SPI driver module.
27035  <p><b>Implementation:</b> Static/Dynamic</p>
27036  Description:
27037  This function provides the current status of the SPI driver module.
27038  Precondition:
27039  The DRV_SPI_Initialize function must have been called before calling
27040  this function.
27041  Parameters:
27042  object - Driver object handle, returned from DRV_SPI_Initialize
27043  Returns:
27044  - SYS_STATUS_READY - Indicates that the driver is busy with a previous
27045  system level operation and cannot start another
27046  Example:
27047  <code>
27048  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
27049  SYS_STATUS status;
27050  status = DRV_SPI_Status( object );
27051  if( SYS_STATUS_READY != status )
27052  {
27053  // Handle error
27054  }
27055  </code>
27056  Remarks:
27057  Any value greater than SYS_STATUS_READY is also a normal running state
27058  in which the driver is ready to accept new operations.
27059  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been
27060  deinitialized
27061  This value is less than SYS_STATUS_ERROR.
27062  This function can be used to determine when any of the driver's module
27063  level operations has completed.
27064  If the status operation returns SYS_STATUS_BUSY, the previous operation
27065  has not yet completed. Once the status operation returns
27066  SYS_STATUS_READY, any previous operations have completed.
27067  The value of SYS_STATUS_ERROR is negative (-1). Any value less than
27068  that is also an error state.
27069  This function will NEVER block waiting for hardware.
27070  If the Status operation returns an error value, the error may be
27071  cleared by calling the reinitialize operation. If that fails, the
27072  deinitialize operation will need to be called, followed by the
27073  initialize operation to return to normal operations.
27074 */
27075 
27076 SYS_STATUS
27077  DRV_SPI_Status (
27078  SYS_MODULE_OBJ object ) ;
27079 // *****************************************************************************
27080 /* Function:
27081  void DRV_SPI_Tasks ( SYS_MODULE_OBJ object );
27082  Summary:
27083  Maintains the driver's state machine and implements its ISR.
27084  <p><b>Implementation:</b> Static/Dynamic</p>
27085  Description:
27086  This routine is used to maintain the driver's internal state
27087  machine and implement its transmit ISR for interrupt-driven implementations.
27088  In polling mode, this function should be called from the SYS_Tasks()
27089  function. In interrupt mode, this function should be called in the transmit
27090  interrupt service routine of the USART that is associated with this USART
27091  driver hardware instance.
27092  Precondition:
27093  The DRV_SPI_Initialize routine must have been called for the specified
27094  SPI driver instance.
27095  Parameters:
27096  object - Object handle for the specified driver instance (returned from
27097  DRV_SPI_Initialize)
27098  Returns:
27099  None.
27100  Example:
27101  <code>
27102  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
27103  while( true )
27104  {
27105  DRV_SPI_Tasks ( object );
27106  // Do other tasks
27107  }
27108  </code>
27109  Remarks:
27110  This function is normally not called directly by an application. It is
27111  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
27112  ISR.
27113  This function may execute in an ISR context and will never block or access any
27114  resources that may cause it to block.
27115 */
27116 
27117 void
27118  DRV_SPI_Tasks (
27119  SYS_MODULE_OBJ object ) ;
27120 // *****************************************************************************
27121 // *****************************************************************************
27122 // Section: Interface Routines - Client Level
27123 // *****************************************************************************
27124 // *****************************************************************************
27125 //**************************************************************************
27126 /* Function:
27127  DRV_HANDLE DRV_SPI_Open ( const SYS_MODULE_INDEX drvIndex,
27128  const DRV_IO_INTENT ioIntent )
27129  Summary:
27130  Opens the specified SPI driver instance and returns a handle to it.
27131  <p><b>Implementation:</b> Static/Dynamic</p>
27132  Description:
27133  This routine opens the specified SPI driver instance and provides a
27134  handle that must be provided to all other client-level operations to
27135  identify the caller and the instance of the driver. The ioIntent
27136  parameter defines how the client interacts with this driver instance.
27137  If ioIntent is DRV_IO_INTENT_READ, the client will only be read from
27138  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be
27139  able to write to the driver. If the ioIntent in
27140  DRV_IO_INTENT_READWRITE, the client will be able to do both, read and
27141  write.
27142  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
27143  exclusive access to this client. The driver cannot be opened by any
27144  other client.
27145  Precondition:
27146  The DRV_SPI_Initialize function must have been called before calling
27147  this function.
27148  Parameters:
27149  drvIndex - Index of the driver initialized with DRV_SPI_Initialize().
27150  Please note this is not the SPI ID.
27151  ioIntent - Zero or more of the values from the enumeration
27152  DRV_IO_INTENT ORed together to indicate the intended use of
27153  the driver
27154  Returns:
27155  If successful, the routine returns a valid open-instance handle (a
27156  number identifying both the caller and the module instance).
27157  If an error occurs, the return value is DRV_HANDLE_INVALID. An error
27158  can occur when the following is true:
27159  * if the number of client objects allocated via
27160  DRV_SPI_INSTANCES_NUMBER is insufficient
27161  * if the client is trying to open the driver but driver has been
27162  opened exclusively by another client
27163  * if the driver hardware instance being opened is not initialized or
27164  is invalid
27165  Example:
27166  <code>
27167  DRV_HANDLE handle;
27168  handle = DRV_SPI_Open( DRV_SPI_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
27169  if( DRV_HANDLE_INVALID == handle )
27170  {
27171  // Unable to open the driver
27172  }
27173  </code>
27174  Remarks:
27175  The handle returned is valid until the DRV_SPI_Close routine is
27176  called. This routine will NEVER block waiting for hardware. If the
27177  requested intent flags are not supported, the routine will return
27178  DRV_HANDLE_INVALID. This function is thread safe in a RTOS application.
27179  It should not be called in an ISR.
27180 */
27181 
27182 DRV_HANDLE
27183  DRV_SPI_Open (
27184  const SYS_MODULE_INDEX drvIndex ,
27185  const DRV_IO_INTENT ioIntent ) ;
27186 //**************************************************************************
27187 /* Function:
27188  int32_t DRV_SPI_ClientConfigure ( DRV_HANDLE handle,
27189  const DRV_SPI_CLIENT_DATA * cfgData )
27190  Summary:
27191  Configures a SPI client with specific data.
27192  <p><b>Implementation:</b> Static/Dynamic</p>
27193  Description:
27194  This routine takes a DRV_SPI_CLIENT_DATA structure and sets client specific options.
27195  Whenever a new SPI job is started these values will be used. Passing in NULL will
27196  reset the client back to configuration parameters passed to driver initialization.
27197  A zero in any of the structure elements will reset that specific configuration back
27198  to the driver default.
27199  Precondition:
27200  The DRV_SPI_Open function must have been called before calling
27201  this function.
27202  Parameters:
27203  handle - handle of the client returned by DRV_SPI_Open.
27204  cfgData - Client-specific configuration data.
27205  Returns:
27206  - If successful - the routing will return greater than or equal to zero
27207  - If an error occurs - the return value is negative
27208 */
27209 
27210 int32_t
27212  DRV_HANDLE handle ,
27213  const DRV_SPI_CLIENT_DATA * cfgData ) ;
27214 // *****************************************************************************
27215 /* Function:
27216  void DRV_SPI_Close ( DRV_HANDLE handle )
27217  Summary:
27218  Closes an opened instance of the SPI driver.
27219  <p><b>Implementation:</b> Static/Dynamic</p>
27220  Description:
27221  This function closes an opened instance of the SPI driver, invalidating the
27222  handle.
27223  Precondition:
27224  The DRV_SPI_Initialize routine must have been called for the specified
27225  SPI driver instance.
27226  DRV_SPI_Open must have been called to obtain a valid opened device handle.
27227  Parameters:
27228  handle - A valid open-instance handle, returned from the driver's
27229  open routine
27230  Returns:
27231  None.
27232  Example:
27233  <code>
27234  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27235  DRV_SPI_Close ( handle );
27236  </code>
27237  Remarks:
27238  After calling this routine, the handle passed in "handle" must not be used
27239  with any of the remaining driver routines. A new handle must be obtained by
27240  calling DRV_SPI_Open before the caller may use the driver again. This
27241  function is thread safe in a RTOS application.
27242  Note:
27243  Usually there is no need for the driver client to verify that the Close
27244  operation has completed.
27245 */
27246 
27247 void
27248  DRV_SPI_Close (
27249  DRV_HANDLE handle ) ;
27250 // *****************************************************************************
27251 // *****************************************************************************
27252 // Section: Interface Routines - Client level Read & Write APIs
27253 // *****************************************************************************
27254 // *****************************************************************************
27255 /* These are non-blocking APIs. It doesn't wait until the operation gets
27256  finished. The actual operation will happen it the task routine. The status of
27257  this operation can be monitored using DRV_SPI_BufferStatus function. In
27258  polling mode, User must ensure that the code gets time to execute the task
27259  routine. */
27260 //*******************************************************************************
27261 /* Function:
27262  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead ( DRV_HANDLE handle, void *rxBuffer,
27263  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27264  void * context )
27265  Summary:
27266  Registers a buffer for a read operation. Actual transfer will happen in
27267  the Task function.
27268  <p><b>Implementation:</b> Static/Dynamic</p>
27269  Description:
27270  Registers a buffer for a read operation. Actual transfer will happen in
27271  the Task function. The status of this operation can be monitored using
27272  DRV_SPI_BufferStatus function. A optional callback can also be
27273  provided that will be called when the operation is complete.
27274  Precondition:
27275  The DRV_SPI_Initialize routine must have been called for the specified
27276  SPI driver instance.
27277  DRV_SPI_Open must have been called to obtain a valid opened device
27278  handle.
27279  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
27280  in the DRV_SPI_Open call.
27281  Parameters:
27282  handle - A valid open-instance handle, returned from the driver's
27283  open routine
27284  rxBuffer - The buffer to which the data should be written to.
27285  size - Number of bytes to be read from the SPI bus.
27286  completeCB - Pointer to a function to be called when this queued operation is complete.
27287  context - unused by the driver but this is passed to the callback when it is called.
27288  Returns:
27289  If the buffer add request is successful, a valid buffer handle is returned.
27290  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27291  Example:
27292  <code>
27293  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27294  char myBuffer[MY_BUFFER_SIZE], state = 0;
27295  DRV_SPI_BUFFER_HANDLE bufferHandle;
27296  switch ( state )
27297  {
27298  case 0:
27299  bufferHandle = DRV_SPI_BufferAddRead( handle, myBuffer, 10, NULL, NULL );
27300  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27301  {
27302  state++;
27303  }
27304  break;
27305  case 1:
27306  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27307  {
27308  state++;
27309  // All transmitter data has been sent successfully.
27310  }
27311  break;
27312  }
27313  </code>
27314  Remarks:
27315  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddRead2"
27316  instead of it.
27317  */
27318 
27321  DRV_HANDLE handle ,
27322  void * rxBuffer ,
27323  size_t size ,
27324  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27325  void * context ) ;
27326 //*******************************************************************************
27327 /* Function:
27328  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite ( DRV_HANDLE handle, void *txBuffer,
27329  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27330  void * context )
27331  Summary:
27332  Registers a buffer for a write operation. Actual transfer will happen
27333  in the Task function.
27334  <p><b>Implementation:</b> Static/Dynamic</p>
27335  Description:
27336  Registers a buffer for a write operation. Actual transfer will happen
27337  in the Task function. The status of this operation can be monitored
27338  using DRV_SPI_BufferStatus function. A optional callback can also be
27339  provided that will be called when the operation is complete.
27340  Precondition:
27341  The DRV_SPI_Initialize routine must have been called for the specified
27342  SPI driver instance.
27343  DRV_SPI_Open must have been called to obtain a valid opened device
27344  handle.
27345  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27346  in the DRV_SPI_Open call.
27347  Parameters:
27348  handle - A valid open-instance handle, returned from the driver's
27349  open routine
27350  txBuffer - The buffer which hold the data.
27351  size - Number of bytes to be written to the SPI bus.
27352  completeCB - Pointer to a function to be called when this queued operation is complete
27353  context - unused by the driver but this is passed to the callback when it is called
27354  Returns:
27355  If the buffer add request is successful, a valid buffer handle is returned.
27356  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27357  Example:
27358  <code>
27359  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27360  char myBuffer[MY_BUFFER_SIZE], state = 0;
27361  DRV_SPI_BUFFER_HANDLE bufferHandle;
27362  switch ( state )
27363  {
27364  case 0:
27365  bufferHandle = DRV_SPI_BufferAddWrite( handle, myBuffer, 10, NULL, NULL );
27366  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27367  {
27368  state++;
27369  }
27370  break;
27371  case 1:
27372  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27373  {
27374  state++;
27375  // All transmitter data has been sent successfully.
27376  }
27377  break;
27378  }
27379  </code>
27380  Remarks:
27381  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWrite2"
27382  instead of it.
27383 */
27384 
27387  DRV_HANDLE handle ,
27388  void * txBuffer ,
27389  size_t size ,
27390  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27391  void * context ) ;
27392 //*******************************************************************************
27393 /* Function:
27394  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead( DRV_HANDLE handle,
27395  void *txBuffer, void *rxBuffer, size_t size, )
27396  Summary:
27397  Registers a buffer for a read and write operation. Actual transfer will
27398  happen in the Task function.
27399  <p><b>Implementation:</b> Static/Dynamic</p>
27400  Description:
27401  Registers a buffer for a read and write operation. Actual transfer will
27402  happen in the Task function. The status of this operation can be
27403  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27404  provided that will be called when the operation is complete.
27405  Precondition:
27406  The DRV_SPI_Initialize routine must have been called for the specified
27407  SPI driver instance.
27408  DRV_SPI_Open must have been called to obtain a valid opened device
27409  handle.
27410  Parameters:
27411  handle - A valid open-instance handle, returned from the driver's
27412  open routine
27413  txBuffer - The buffer which hold the data.
27414  txSize - Number of bytes to be written to the SPI bus.
27415  rxBuffer - The buffer to which the data should be written to.
27416  rxSize - Number of bytes to be read from the SPI bus
27417  completeCB - Pointer to a function to be called when this queued operation is complete
27418  context - unused by the driver but this is passed to the callback when it is called
27419  Returns:
27420  If the buffer add request is successful, a valid buffer handle is returned.
27421  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27422  Example:
27423  <code>
27424  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27425  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27426  DRV_SPI_BUFFER_HANDLE bufferHandle;
27427  switch ( state )
27428  {
27429  case 0:
27430  bufferHandle = DRV_SPI_BufferAddWriteRead( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL );
27431  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27432  {
27433  state++;
27434  }
27435  break;
27436  case 1:
27437  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27438  {
27439  state++;
27440  // All transmitter data has been sent successfully.
27441  }
27442  break;
27443  }
27444  </code>
27445  Remarks:
27446  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWriteRead2"
27447  instead of it.
27448 */
27449 
27452  DRV_HANDLE handle ,
27453  void * txBuffer ,
27454  size_t txSize ,
27455  void * rxBuffer ,
27456  size_t rxSize ,
27457  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27458  void * context ) ;
27459 //*******************************************************************************
27460 /* Function:
27461  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2 ( DRV_HANDLE handle, void *rxBuffer,
27462  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27463  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27464  Summary:
27465  Registers a buffer for a read operation. Actual transfer will happen in
27466  the Task function.
27467  <p><b>Implementation:</b> Static/Dynamic</p>
27468  Description:
27469  Registers a buffer for a read operation. Actual transfer will happen in
27470  the Task function. The status of this operation can be monitored using
27471  DRV_SPI_BufferStatus function. A optional callback can also be
27472  provided that will be called when the operation is complete.
27473  Precondition:
27474  The DRV_SPI_Initialize routine must have been called for the specified
27475  SPI driver instance.
27476  DRV_SPI_Open must have been called to obtain a valid opened device
27477  handle.
27478  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
27479  in the DRV_SPI_Open call.
27480  Parameters:
27481  handle - A valid open-instance handle, returned from the driver's
27482  open routine
27483  rxBuffer - The buffer to which the data should be written to.
27484  size - Number of bytes to be read from the SPI bus.
27485  completeCB - Pointer to a function to be called when this queued operation is complete
27486  context - unused by the driver but this is passed to the callback when it is called
27487  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27488  Returns:
27489  If the buffer add request is successful, a valid buffer handle is returned.
27490  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27491  Example:
27492  <code>
27493  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27494  char myBuffer[MY_BUFFER_SIZE], state = 0;
27495  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27496  switch ( state )
27497  {
27498  case 0:
27499  bufferHandle = DRV_SPI_BufferAddRead2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27500  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27501  {
27502  state++;
27503  }
27504  break;
27505  case 1:
27506  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27507  {
27508  state++;
27509  // All transmitter data has been sent successfully.
27510  }
27511  break;
27512  }
27513  </code>
27514  Remarks:
27515  None.
27516  */
27517 
27520  DRV_HANDLE handle ,
27521  void * rxBuffer ,
27522  size_t size ,
27523  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27524  void * context ,
27525  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27526 //*******************************************************************************
27527 /* Function:
27528  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2 ( DRV_HANDLE handle, void *txBuffer,
27529  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27530  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27531  Summary:
27532  Registers a buffer for a write operation. Actual transfer will happen
27533  in the Task function.
27534  <p><b>Implementation:</b> Static/Dynamic</p>
27535  Description:
27536  Registers a buffer for a write operation. Actual transfer will happen
27537  in the Task function. The status of this operation can be monitored
27538  using DRV_SPI_BufferStatus function. A optional callback can also be
27539  provided that will be called when the operation is complete.
27540  Precondition:
27541  The DRV_SPI_Initialize routine must have been called for the specified
27542  SPI driver instance.
27543  DRV_SPI_Open must have been called to obtain a valid opened device
27544  handle.
27545  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27546  in the DRV_SPI_Open call.
27547  Parameters:
27548  handle - A valid open-instance handle, returned from the driver's
27549  open routine
27550  txBuffer - The buffer which hold the data.
27551  size - Number of bytes to be written to the SPI bus.
27552  completeCB - Pointer to a function to be called when this queued operation is complete
27553  context - unused by the driver but this is passed to the callback when it is called
27554  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27555  Returns:
27556  If the buffer add request is successful, a valid buffer handle is returned.
27557  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27558  Example:
27559  <code>
27560  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27561  char myBuffer[MY_BUFFER_SIZE], state = 0;
27562  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27563  switch ( state )
27564  {
27565  case 0:
27566  bufferHandle = DRV_SPI_BufferAddWrite2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27567  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27568  {
27569  state++;
27570  }
27571  break;
27572  case 1:
27573  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27574  {
27575  state++;
27576  // All transmitter data has been sent successfully.
27577  }
27578  break;
27579  }
27580  </code>
27581  Remarks:
27582  None.
27583 */
27584 
27587  DRV_HANDLE handle ,
27588  void * txBuffer ,
27589  size_t size ,
27590  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27591  void * context ,
27592  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27593 //*******************************************************************************
27594 /* Function:
27595  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2( DRV_HANDLE handle,
27596  void *txBuffer, void *rxBuffer, size_t size,
27597  DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27598  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27599  Summary:
27600  Registers a buffer for a read and write operation. Actual transfer will
27601  happen in the Task function.
27602  <p><b>Implementation:</b> Static/Dynamic</p>
27603  Description:
27604  Registers a buffer for a read and write operation. Actual transfer will
27605  happen in the Task function. The status of this operation can be
27606  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27607  provided that will be called when the operation is complete.
27608  Precondition:
27609  The DRV_SPI_Initialize routine must have been called for the specified
27610  SPI driver instance.
27611  DRV_SPI_Open must have been called to obtain a valid opened device
27612  handle.
27613  Parameters:
27614  handle - A valid open-instance handle, returned from the driver's
27615  open routine
27616  txBuffer - The buffer which hold the data.
27617  txSize - Number of bytes to be written to the SPI bus.
27618  rxBuffer - The buffer to which the data should be written to.
27619  rxSize - Number of bytes to be read from the SPI bus
27620  completeCB - Pointer to a function to be called when this queued operation is complete
27621  context - unused by the driver but this is passed to the callback when it is called
27622  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27623  Returns:
27624  If the buffer add request is successful, a valid buffer handle is returned.
27625  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27626  Example:
27627  <code>
27628  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27629  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27630  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27631  switch ( state )
27632  {
27633  case 0:
27634  bufferHandle = DRV_SPI_BufferAddWriteRead2( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL, &bufferHandle2 );
27635  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27636  {
27637  state++;
27638  }
27639  break;
27640  case 1:
27641  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27642  {
27643  state++;
27644  // All transmitter data has been sent successfully.
27645  }
27646  break;
27647  }
27648  </code>
27649  Remarks:
27650  None.
27651 */
27652 
27655  DRV_HANDLE handle ,
27656  void * txBuffer ,
27657  size_t txSize ,
27658  void * rxBuffer ,
27659  size_t rxSize ,
27660  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27661  void * context ,
27662  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27663 // *****************************************************************************
27664 /* Function:
27665  DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus ( DRV_SPI_BUFFER_HANDLE bufferHandle )
27666  Summary:
27667  Returns the transmitter and receiver transfer status.
27668  <p><b>Implementation:</b> Static/Dynamic</p>
27669  Description:
27670  This returns the transmitter and receiver transfer status.
27671  Precondition:
27672  The DRV_SPI_Initialize routine must have been called for the specified
27673  SPI driver instance.
27674  DRV_SPI_Open must have been called to obtain a valid opened device handle.
27675  DRV_SPI_BufferAdd<Transfer> must have been called to obtain
27676  the buffer handle associated with that transfer.
27677  Parameters:
27678  bufferHandle - A valid buffer handle, returned from the driver's
27679  data transfer routine
27680  Returns:
27681  A DRV_SPI_BUFFER_STATUS value describing the current status of the
27682  transfer.
27683  Example:
27684  <code>
27685  // Buffer handle returned from the data transfer function
27686  DRV_SPI_BUFFER_HANDLE bufferHandle;
27687  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27688  {
27689  // All transmitter data has been sent.
27690  }
27691  </code>
27692  Remarks:
27693  The returned status may contain a value with more than one of the bits
27694  specified in the DRV_SPI_BUFFER_STATUS enumeration set. The caller
27695  should perform an AND with the bit of interest and verify if the
27696  result is non-zero (as shown in the example) to verify the desired status
27697  bit.
27698 */
27699 
27702  DRV_SPI_BUFFER_HANDLE bufferHandle ) ;
27703 // *****************************************************************************
27704 /* Function:
27705  bool DRV_SPIn_ReceiverBufferIsFull(void)
27706  Summary:
27707  Returns the receive buffer status. 'n' represents the instance of the
27708  SPI driver used.
27709  <p><b>Implementation:</b> Static</p>
27710  Description:
27711  This function returns the receive buffer status (full/empty).
27712  Precondition:
27713  None.
27714  Parameters:
27715  None.
27716  Returns:
27717  Receive Buffer Status
27718  - 1 - Full
27719  - 0 - Empty
27720  Example:
27721  <code>
27722  bool rxBufStat;
27723  // Using instance 1 of SPI driver, that is n = 1
27724  rxBufStat = DRV_SPI1_ReceiverBufferIsFull();
27725  if (rxBufStat)
27726  {
27727  ...
27728  }
27729  </code>
27730  Remarks:
27731  None.
27732 */
27733 
27734 bool
27736 // *****************************************************************************
27737 /* Function:
27738  bool DRV_SPIn_TransmitterBufferIsFull(void)
27739  Summary:
27740  Returns the transmit buffer status. 'n' represents the instance of the
27741  SPI driver used.
27742  <p><b>Implementation:</b> Static</p>
27743  Description:
27744  This function returns the transmit buffer status (full/empty).
27745  Precondition:
27746  None.
27747  Parameters:
27748  None.
27749  Returns:
27750  Transmit Buffer Status
27751  - 1 - Full
27752  - 0 - Empty
27753  Example:
27754  <code>
27755  bool txBufStat;
27756  // Using instance 1 of SPI driver, that is n = 1
27757  txBufStat = DRV_SPI1_TransmitterBufferIsFull();
27758  if (txBufStat)
27759  {
27760  ...
27761  }
27762  </code>
27763  Remarks:
27764  None.
27765 */
27766 
27767 bool
27769 //DOM-IGNORE-BEGIN
27770 //DOM-IGNORE-END
27771  // #ifndef _DRV_SPI_H
27772 /*******************************************************************************
27773  End of File
27774 */
27775 
27776 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h*/
27777 /* CLOSE_FILE Include File */
27778 
27779 #include "driver/usb/usbhs/drv_usbhs.h"
27780 #include "usb/usb_device.h"
27781 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h */
27782 /**************************************************************************************/
27783 /* LDRA_INSPECTED 110 S
27784 */
27800 /**************************************************************************************/
27801 #ifndef APP_H /* Guard against multiple inclusion.*/
27802 #define APP_H
27803 /**************************************************************************************/
27804 /* ************************************************************************************/
27805 /* Section: Included Files */
27806 /**************************************************************************************/
27807 /**************************************************************************************/
27808 #include <stdint.h>
27809 /**************************************************************************************/
27810 /**************************************************************************************/
27811 /* Section: Data Types */
27812 /**************************************************************************************/
27813 /**************************************************************************************/
27814 /**************************************************************************************/
27815 /* APP_DATA
27816  Summary:
27817  Holds APP_DATA used for the APP tasks.
27818  Description:
27819  Holds APP_DATA used for the APP tasks. The variables
27820  used are stored here.
27821  Remarks:
27822  None
27823  */
27824 
27825 typedef
27826  struct
27827  {
27828  uint8_t RevNumber ;
27829  } APP_DATA ;
27830 
27831 extern APP_DATA
27832  APP ;
27833 /**************************************************************************************/
27834 /**************************************************************************************/
27835 /* Section: Application Initialization and State Machine Functions */
27836 /**************************************************************************************/
27837 /**************************************************************************************/
27838 /*!*************************************************************************************
27839  Function:
27840  void APP_Initialize(void)
27841  Summary:
27842  Autonomous tool application initialization routine.
27843  Description:
27844  This function initializes the application. It places the
27845  application in its initial state and prepares it to run so that its
27846  APP_Tasks function can be called.
27847  Precondition:
27848  All other system initialization routines should be called before calling
27849  this routine (in "SYS_Initialize").
27850  Parameters:
27851  None.
27852  Returns:
27853  None.
27854  Example:
27855  APP_Initialize()
27856  Remarks:
27857  This routine must be called from the main function.
27858 */
27859 
27860 void
27861  APP_Initialize ( void ) ;
27862 /*!*************************************************************************************
27863  Function:
27864  void APP_Tasks(void)
27865  Summary:
27866  Application tasks function
27867  Description:
27868  This function is the main application's tasks function. It contains the various
27869  tasks that are maintained during the operation of the shooting panel.
27870  Precondition:
27871  The system ("SYS_Initialize") and application ("APP_Initialize") initialization
27872  should be called before calling this.
27873  Parameters:
27874  None.
27875  Returns:
27876  None.
27877  Example:
27878  APP_Tasks()
27879  Remarks:
27880  This routine must be called from the main() routine.
27881  */
27882 
27883 void
27884  APP_Tasks ( void ) ;
27885  /* APP_H */
27886 /***************************************************************************************
27887  End of File
27888  */
27889 
27890 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h*/
27891 /* CLOSE_FILE Include File */
27892 
27893 // DOM-IGNORE-BEGIN
27894 // DOM-IGNORE-END
27895 // *****************************************************************************
27896 // *****************************************************************************
27897 // Section: Type Definitions
27898 // *****************************************************************************
27899 // *****************************************************************************
27900 // *****************************************************************************
27901 /* System Objects
27902  Summary:
27903  Structure holding the system's object handles
27904  Description:
27905  This structure contains the object handles for all objects in the
27906  MPLAB Harmony project's system configuration.
27907  Remarks:
27908  These handles are returned from the "Initialize" functions for each module
27909  and must be passed into the "Tasks" function for each module.
27910 */
27911 
27912 typedef
27913  struct
27914  {
27915  SYS_MODULE_OBJ sysTmr ;
27916  SYS_MODULE_OBJ drvTmr0 ;
27917  SYS_MODULE_OBJ drvTmr1 ;
27918  SYS_MODULE_OBJ drvTmr2 ;
27919  SYS_MODULE_OBJ drvTmr3 ;
27920  SYS_MODULE_OBJ drvTmr4 ;
27921  SYS_MODULE_OBJ drvUsart0 ;
27922  SYS_MODULE_OBJ drvPMP0 ;
27923  /*** SPI Object for Index 0 ***/
27924  SYS_MODULE_OBJ spiObjectIdx0 ;
27925  /*** SPI Object for Index 1 ***/
27926  SYS_MODULE_OBJ spiObjectIdx1 ;
27927  /*** SPI Object for Index 2 ***/
27928  SYS_MODULE_OBJ spiObjectIdx2 ;
27929  SYS_MODULE_OBJ drvUSBObject ;
27930  SYS_MODULE_OBJ usbDevObject0 ;
27931  } SYSTEM_OBJECTS ;
27932 // *****************************************************************************
27933 // *****************************************************************************
27934 // Section: extern declarations
27935 // *****************************************************************************
27936 // *****************************************************************************
27937 
27938 extern SYSTEM_OBJECTS
27939  sysObj ;
27940 //DOM-IGNORE-BEGIN
27941 //DOM-IGNORE-END
27942  /* _SYS_DEFINITIONS_H */
27943 /*******************************************************************************
27944  End of File
27945 */
27946 
27947 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h*/
27948 /* CLOSE_FILE Include File */
27949 
27950 /**************************************************************************************/
27951 /**************************************************************************************/
27952 /* Section: Data Types */
27953 /**************************************************************************************/
27954 /**************************************************************************************/
27955 /**************************************************************************************/
27956 /* HVPS_STATES
27957  Summary:
27958  HVPS_STATES enumeration
27959  Description:
27960  This enumeration defines the valid HVPS states. These states
27961  determine the behavior of the HVPS state machine at various times.
27962 */
27963 
27964 typedef
27965  enum
27966  {
27979  } HVPS_STATES ;
27980 /**************************************************************************************/
27981 /* HVPS_DATA
27982  Summary:
27983  Holds HVPS_DATA used for the HVPS tasks.
27984  Description:
27985  Holds HVPS_DATA used for the HVPS tasks. The state machine and variables
27986  used to control HVPS functions are stored here.
27987  Remarks:
27988  None
27989  */
27990 
27991 typedef
27992  struct /* This structure collects the variables and states required for these*/
27993  {
27994  /* functions to operate.*/
27995  HVPS_STATES state ;
27996  DRV_HANDLE drvSPIHandle ;
27997  DRV_SPI_BUFFER_HANDLE bufferHandle ;
27998  DRV_SPI_BUFFER_HANDLE bufferHandle2 ;
27999  bool spi_write_complete_flag ;
28000  bool spi_sent_flag ;
28001  uint16_t adj [ 1 ] ;
28002  uint16_t cont_in ;
28003  bool pot_switch ;
28004  bool new_cont_values_flag ;
28005  bool tick ;
28006  uint16_t cont_prev ;
28007  uint16_t cont_new ;
28008  uint16_t count ;
28009  bool pos_dir ;
28010  bool shutdown ;
28011  uint16_t update_rate ;
28012  uint16_t rate_time ;
28013  uint16_t update_count ;
28014  bool update_flag ;
28015  uint16_t voltage ;
28016  uint16_t current ;
28017  uint16_t sensor_offset ;
28018  uint16_t offset ;
28019  uint16_t sensor_constant ;
28020  uint16_t max_current ;
28021  uint16_t current_limit ;
28022  uint16_t upper_current_limit ;
28023  uint8_t over_current_count ;
28024  bool new_current_values_flag ;
28025  bool new_voltage_values_flag ;
28026  bool overcurrent_flag ;
28027  bool overvoltage_flag ;
28028  } HVPS_DATA ;
28029 
28030 extern HVPS_DATA
28031  HV_PS ;
28032 /**************************************************************************************/
28033 /**************************************************************************************/
28034 /* Section: Interface Functions */
28035 /**************************************************************************************/
28036 /**************************************************************************************/
28037 /*!*************************************************************************************
28038  Function:
28039  void Set_HVPS_Ramp_Rate( uint16_t value )
28040  Summary:
28041  This function sets update rate for the HVPS control voltage.
28042  Description:
28043  This function sets update rate for the HVPS control voltage. Value is a rate in
28044  volts/second. This value is then converted to an update rate for the control DAC.
28045  For example, an update value of 100V/second gives an DAC update rate of approx.
28046  20mS. This update rate is used with Timer 1 to control when the control DAC is
28047  updated.
28048 
28049  Precondition:
28050  None.
28051  Parameters:
28052  uint16_t value: Value representing volts/second.
28053  Returns
28054  None.
28055 
28056  Remarks:
28057  None.
28058 
28059  Example:
28060  SET_WL_SPS_IOffset( unsigned char mode )
28061  */
28062 
28063 void
28065  uint16_t value ) ;
28066 /**************************************************************************************/
28067 /**************************************************************************************/
28068 /* State Machine Functions */
28069 /**************************************************************************************/
28070 /**************************************************************************************/
28071 /*!*************************************************************************************
28072  Function:
28073  void HVPS_Tasks(void)
28074  Summary:
28075  HVPS tasks function
28076  Description:
28077  This routine is the HVPS tasks function. It defines the HVPS's state machine and
28078  core logic.
28079  Precondition:
28080  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28081  should be called before calling this.
28082  Parameters:
28083  None.
28084  Returns:
28085  None.
28086  Example:
28087  HVPS_Tasks()
28088 
28089  Remarks:
28090  This routine must be called from APP_Tasks() routine.
28091  */
28092 
28093 void
28094  HVPS_Tasks ( void ) ;
28095  /* HVPS_H */
28096 /***************************************************************************************
28097  End of File
28098  */
28099 
28100 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\hvps.h*/
28101 /* CLOSE_FILE Include File */
28102 
28103 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_sps.h */
28104 /**************************************************************************************/
28120 /**************************************************************************************/
28121 #ifndef WL_SPS_H /* Guard against multiple inclusion */
28122 #define WL_SPS_H
28123 /**************************************************************************************/
28124 /**************************************************************************************/
28125 /* Section: Included Files */
28126 /**************************************************************************************/
28127 /**************************************************************************************/
28128 #include "../system_config.h"
28129 #include "../system_definitions.h"
28130 #include <stdbool.h>
28131 /**************************************************************************************/
28132 /**************************************************************************************/
28133 /* Section: Defines */
28134 /**************************************************************************************/
28135 /**************************************************************************************/
28136  /* A brief description of a section can be given directly below the section
28137  banner.
28138  */
28139 #define NEGATIVE_OFFSET 0x02U
28140 #define POS_HIGH_OFFSET 0x01U
28141 #define POS_LOW_OFFSET 0x03U
28142 #define DEFAULT_OFFSET 0x04U
28143 #define I_ARRAY_SIZE 50U
28144 
28145 typedef
28146 float
28148 /**************************************************************************************/
28149 /**************************************************************************************/
28150 /* Section: Data Types */
28151 /**************************************************************************************/
28152 /**************************************************************************************/
28153 /**************************************************************************************/
28154 /* WL_SPS_STATES
28155  Summary:
28156  WL_SPS_STATES enumeration
28157  Description:
28158  This enumeration defines the valid WL_SPS states. These states
28159  determine the behavior of the WL_SPS state machine at various times.
28160 */
28161 
28162 typedef
28163  enum
28164  {
28172  } WL_SPS_STATES ;
28173 /**************************************************************************************/
28174 /* WL_SPS_DATA
28175  Summary:
28176  Holds WL_SPS_DATA used for the WL_SPS tasks.
28177  Description:
28178  Holds WL_SPS_DATA used for the WL_SPS tasks. The state machine and variables
28179  used to control WL_SPS functions are stored here.
28180  Remarks:
28181  None
28182  */
28183 
28184 typedef
28185  struct
28186  {
28187  WL_SPS_STATES state ;
28188  DRV_HANDLE drvICHandle ;
28189  uint16_t voltage ;
28190  uint16_t voltage_limit ;
28191  uint16_t upper_voltage_limit ;
28192  uint16_t volt_count ;
28193  uint16_t current ;
28194  uint16_t max_current ;
28195  uint16_t current_limit ;
28196  uint16_t upper_current_limit ;
28197  uint8_t over_current_count ;
28198  uint8_t array_sum_count ;
28199  uint8_t array_count ;
28200  uint16_t offset ;
28201  int16_t i_array [ 50U ] ;
28202  int16_t i_sum ;
28203  bool new_current_values_flag ;
28204  bool new_voltage_values_flag ;
28205  bool overcurrent_flag ;
28206  bool overvoltage_flag ;
28207  uint16_t sensor_offset ;
28208  uint16_t sensor_constant ;
28209  bool sensor_offset_tick ;
28210  uint16_t v_array [ 50 ] ;
28211  uint16_t v_array_count ;
28212  uint32_t v_sum ;
28213  float32_t v_avg ;
28214  bool tick ;
28215  uint8_t no_count ;
28216  bool array_full ;
28217  uint8_t overvoltage_count ;
28218  } WL_SPS_DATA ;
28219 
28220 extern WL_SPS_DATA
28221  WL_SPS ;
28222 /**************************************************************************************/
28223 /**************************************************************************************/
28224 /* Section: Interface Functions */
28225 /**************************************************************************************/
28226 /**************************************************************************************/
28227 /*!*************************************************************************************
28228  Function:
28229  void SET_WL_SPS_IOffset( uint8_t mode )
28230  Summary:
28231  This function sets the wire-line current offset based on external settings.
28232  Description:
28233  This function sets the wire-line current offset based on external settings.
28234 
28235  Precondition:
28236  None.
28237  Parameters:
28238  None.
28239  Returns
28240  None.
28241 
28242  Remarks:
28243  None.
28244 
28245  Example:
28246  SET_WL_SPS_IOffset( uint8_t mode )
28247  */
28248 
28249 void
28251  uint8_t mode ) ;
28252 /*!*************************************************************************************
28253  Function:
28254  void Set_WL_SPS_CurrentLimit(uint16_t value)
28255  Summary:
28256  This function sets the current limit for the wire-line shooting power
28257  supply (WL_SPS).
28258  Description:
28259  This function sets the current limit for the wire-line shooting power
28260  supply (WL_SPS) and ensures it it not greater than the upper current limit.
28261  If the value programmed is greater than the upper current limit, then the the
28262  current limit is set to the upper current limit value.
28263  This is used in the WL_SPS over current check.
28264 
28265  Precondition:
28266  None.
28267  Parameters:
28268  None.
28269  Returns
28270  None.
28271 
28272  Remarks:
28273  None.
28274 
28275  Example:
28276  Set_WL_SPS_CurrentLimit(uint16_t value)
28277  */
28278 
28279 void
28281  uint16_t value ) ;
28282 /**************************************************************************************/
28283 /**************************************************************************************/
28284 /* State Machine Functions */
28285 /**************************************************************************************/
28286 /**************************************************************************************/
28287 /*!*************************************************************************************
28288  Function:
28289  *
28290  void WL_SPS_Tasks(void)
28291  Summary:
28292  WL_SPS_Tasks function
28293  Description:
28294  This routine is the WL_SPS_Tasks function. It defines the WL_SPS_Tasks state
28295  machine and core logic. This machine is used to monitor the wire-line shooting
28296  power supply (WL_SPS) voltage and current and will set flags when those limits
28297  are exceeded. Those flags are monitored by the HV_PS machine and will turn the
28298  supply off if either of those flags are set.
28299  Precondition:
28300  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28301  should be called before calling this.
28302  Parameters:
28303  None.
28304  Returns:
28305  None.
28306  Remarks:
28307  This routine must be called from the APP_Tasks() routine.
28308  Example:
28309  WL_SPS_Tasks()
28310  */
28311 
28312 void
28313  WL_SPS_Tasks ( void ) ;
28314  /* WL_SPS_H */
28315 /***************************************************************************************
28316  End of File
28317  */
28318 
28319 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_sps.h*/
28320 /* CLOSE_FILE Include File */
28321 
28322 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\statusst.h */
28323 /**************************************************************************************/
28340 /**************************************************************************************/
28341 #ifndef STATUSST_H /* Guard against multiple inclusion */
28342 #define STATUSST_H
28343 /**************************************************************************************/
28344 /**************************************************************************************/
28345 /* Section: Included Files */
28346 /**************************************************************************************/
28347 /**************************************************************************************/
28348 #include <stdbool.h>
28349 #include <stdint.h>
28350 /*typedef unsigned char uchar8_t*/
28351 /**************************************************************************************/
28352 /**************************************************************************************/
28353 /* Section: Interface Functions */
28354 /**************************************************************************************/
28355 /**************************************************************************************/
28356 /*!*************************************************************************************
28357  Function:
28358  void Set_Status(uint8_t bitposn)
28359  Summary:
28360  This function sets the desired bit to a one in the PIB status register.
28361  Description:
28362  This function sets the desired bit to a one in the PIB status register. This is
28363  called by various functions to indicate a command result or switch setting.
28364 
28365  Precondition:
28366  None.
28367  Parameters:
28368  uint8_t bitposn - the desired bit position in the PIB status register.
28369  Returns
28370  None.
28371 
28372  Remarks:
28373  None.
28374 
28375  Example:
28376  Set_Status(6)
28377  */
28378 
28379 void
28380  Set_Status (
28381  uint8_t bitposn ) ;
28382 /*!*************************************************************************************
28383  Function:
28384  void Clear_Status(unsigned short bitposn)
28385  Summary:
28386  This function sets the desired bit to a zero in the PIB status register.
28387  Description:
28388  This function sets the desired bit to a zero in the PIB status register. This is
28389  called by various functions to indicate a command result or switch setting.
28390 
28391  Precondition:
28392  None.
28393  Parameters:
28394  uint8_t bitposn - the desired bit position in the PIB status register.
28395  Returns
28396  None.
28397 
28398  Remarks:
28399  None.
28400 
28401  Example:
28402  ClearStatus(7)
28403  */
28404 
28405 void
28406  Clear_Status (
28407  uint8_t bitposn ) ;
28408 /*!*************************************************************************************
28409  Function:
28410  void Prepare_Return_A(uint8_t byte, uint16_t data2, uint16_t data1 )
28411  Summary:
28412  Function to prepare the protocol A response.
28413  Description:
28414  Function to prepare the protocol A response. The return message is seven bytes.
28415  the first byte is the command that was sent. the next two bytes are the PIB status
28416  register. The next three bytes can contain two - 12 bit data fields. The data is
28417  then transferred to the TxFifo. The CRC for the return message is calculated
28418  and placed in the last byte.
28419 
28420  Precondition:
28421  None.
28422  Parameters:
28423  uint8_t byte - The command byte.
28424  uint16_t data2 - a 12 bit data field.
28425  uint16_t data1 - 1 12 bit data field.
28426  Returns
28427  None.
28428 
28429  Remarks:
28430  None.
28431 
28432  Example:
28433  Prepare_Return_A(CMD.COMMAND[ 0 ], 0, 0)
28434  */
28435 
28436 void
28438  uint8_t byte ,
28439  uint16_t data2 ,
28440  uint16_t data1 ) ;
28441 /*!*************************************************************************************
28442  Function:
28443  void Prepare_Return_B(uint8_t byt[] )
28444  Summary:
28445  Function to prepare the protocol B response.
28446  Description:
28447  Function to prepare the protocol B response. The return message is seven bytes.
28448  the first byte is the command that was sent. the next two bytes are the PIB status
28449  register. The next three bytes can contain a 12 bit Switch status register,
28450  a four bit StateID and an 8 bit Switch ID. The data is then transferred to the
28451  TxFifo. The CRC for the return message is calculated and placed in the last byte.
28452 
28453  Precondition:
28454  None.
28455  Parameters:
28456  uint8_t byt[] - Three received bytes from a PerfSwitch.
28457  Returns
28458  None.
28459 
28460  Remarks:
28461  None.
28462 
28463  Example:
28464  Prepare_Return_B( MAN.msg )
28465  */
28466 
28467 void
28469  uint8_t byt [] ) ;
28470  /* STATUSST_H */
28471 /***************************************************************************************
28472  End of File
28473  */
28474 
28475 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\statusst.h*/
28476 /* CLOSE_FILE Include File */
28477 
28478 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commands.h */
28479 /**************************************************************************************/
28493 /**************************************************************************************/
28494 #ifndef COMMANDS_H /* Guard against multiple inclusion.*/
28495 #define COMMANDS_H
28496 /**************************************************************************************/
28497 /**************************************************************************************/
28498 /* Section: Included Files */
28499 /**************************************************************************************/
28500 /**************************************************************************************/
28501 #include <stdbool.h>
28502 #include <stdint.h>
28503 /**************************************************************************************/
28504 /**************************************************************************************/
28505 /* Section: Global Variables */
28506 /**************************************************************************************/
28507 /**************************************************************************************/
28508 
28509 extern bool
28510  DepthStatus ;
28511 /**************************************************************************************/
28512 /**************************************************************************************/
28513 /* Section: Type Definition */
28514 /**************************************************************************************/
28515 /**************************************************************************************/
28516 
28517 typedef
28518 unsigned char
28520 /**************************************************************************************/
28521 /**************************************************************************************/
28522 /* Section: Data Types */
28523 /**************************************************************************************/
28524 /**************************************************************************************/
28525 /**************************************************************************************/
28526 
28527 typedef
28528  enum
28529  {
28534  } COMMAND_STATES ;
28535 
28536 typedef
28537  struct /* This structure collects the variables and states required for these*/
28538  {
28539  /* functions to operate.*/
28540  COMMAND_STATES state ;/* The COMMAND_TASKS machine current state.*/
28541  uint16_t crc ;
28542  uint8_t cmd_size ;
28543  uint8_t command [ 7 ] ;
28544  bool process_complete_flag ;
28545  bool b_command_complete_flag ;
28546  bool sw_status_bit_check ;
28547  } COMMAND_DATA ;
28548 
28549 extern COMMAND_DATA
28550  CMD ;
28551 /**************************************************************************************/
28552 /**************************************************************************************/
28553 /* Section: Interface Functions */
28554 /**************************************************************************************/
28555 /**************************************************************************************/
28556 /*!*************************************************************************************
28557  Function:
28558  void COMMAND_Tasks( void )
28559  Summary:
28560  This function executes the commands from the host.
28561  Description:
28562  This function executes the commands from the host. It does this by first ensuring
28563  the CRC of the received command is correct. If the CRC check matches, it goes on
28564  to execute the command. The commands are divided up into three types; Protocol A,
28565  Protocol B and System. Protocol A commands control the function of the Panel
28566  Interface Board. Protocol B commands are for a PerfSwitch or other down hole tool.
28567  System commands control the panel operation while it is being used for shooting.
28568  An example would be showing the depth status.
28569 
28570  Precondition:
28571  None.
28572  Parameters:
28573  None.
28574  Returns
28575  None.
28576 
28577  Remarks:
28578  None.
28579 
28580  Example:
28581  void COMMAND_Tasks()
28582  */
28583 
28584 void
28585  COMMAND_Tasks ( void ) ;
28586 /**************************************************************************************/
28587 /**************************************************************************************/
28588 /* Section: Local Functions */
28589 /**************************************************************************************/
28590 /**************************************************************************************/
28591 /*!*************************************************************************************
28592  Function:
28593  bool Valid_Command( uchar8_t msg )
28594  Summary:
28595  This function compares the received command(first byte)and compares it to a list
28596  of correct commands.
28597  Description:
28598  This function compares the received command(first byte)and compares it to a list
28599  of correct commands. If there is a match, the rest of the transmission is
28600  received for processing. Used in the ValidateComm function in commmodule.c
28601 
28602  Precondition:
28603  None.
28604  Parameters:
28605  uchar8_t msg - The one byte command to compare.
28606  Returns
28607  bool ans - true if command is valid.
28608 
28609  Remarks
28610  None.
28611 
28612  Example:
28613  Valid_Command( command )
28614  */
28615 
28616 bool
28617  Valid_Command (
28618  uchar8_t msg ) ;
28619 /*!*************************************************************************************
28620  Function:
28621  bool GetDepthStatus ( void )
28622  Summary:
28623  This function compares the received command(first byte)and compares it to a list
28624  of correct commands.
28625  Description:
28626  This function compares the received command(first byte)and compares it to a list
28627  of correct commands. If there is a match, the rest of the transmission is
28628  received for processing. Used in the ValidateComm function in commmodule.c
28629 
28630  Precondition:
28631  None.
28632  Parameters:
28633  unsigned char msg - The one byte command to compare.
28634  Returns
28635  unsigned short ans.
28636 
28637  Remarks
28638  None.
28639 
28640  Example:
28641  GetDepthStatus ( )
28642  */
28643 
28644 bool
28645  GetDepthStatus ( void ) ;
28646 /*!*************************************************************************************
28647  Function:
28648  static void Execute_Auto_Protocol_A (void)
28649  Summary:
28650  This function executes the Auto Protocol A commands.
28651  Description:
28652  This function executes the Auto Protocol A commands. These are commands that
28653  control the panel. The commands are listed as case statements. Once the action is
28654  completed, a response is generated and sent back to the host.
28655 
28656  Precondition:
28657  None.
28658  Parameters:
28659  None.
28660  Returns
28661  None.
28662 
28663  Remarks
28664  None.
28665 
28666  Example:
28667  Execute_Auto_Protocol_A ()
28668  */
28669 
28670 static void
28671  Execute_Auto_Protocol_A ( void ) ;
28672 /*!*************************************************************************************
28673  Function:
28674  static void Execute_Protocol_A (void)
28675  Summary:
28676  This function executes the Protocol A commands.
28677  Description:
28678  This function executes the Protocol A commands. These are commands that control
28679  the panel. The commands are listed as case statements. Once the action is
28680  completed, a response is generated and sent back to the host.
28681 
28682  Precondition:
28683  None.
28684  Parameters:
28685  None.
28686  Returns
28687  None.
28688 
28689  Remarks
28690  None.
28691 
28692  Example:
28693  ExecuteProtocolA ()
28694  */
28695 
28696 static void
28697  Execute_Protocol_A ( void ) ;
28698 /*!*************************************************************************************
28699  Function:
28700  static void Execute_Protocol_B (void)
28701  Summary:
28702  This function executes the Protocol B commands.
28703  Description:
28704  This function executes the Protocol B commands. These are commands that are for
28705  a PerfSwitch or other tool. The commands are listed as case statements. Once
28706  the action is completed, a response is generated and sent back to the host.
28707 
28708  Precondition:
28709  None.
28710  Parameters:
28711  None.
28712  Returns
28713  None.
28714 
28715  Remarks
28716  None.
28717 
28718  Example:
28719  ExecuteProtocolB ()
28720  */
28721 
28722 static void
28723  Execute_Protocol_B ( void ) ;
28724 /*!*************************************************************************************
28725  Function:
28726  static void Execute_System(void)
28727  Summary:
28728  This function executes the system commands.
28729  Description:
28730  This function executes the system commands. Once the action is completed, a
28731  response is generated and sent back to the host.
28732 
28733  Precondition:
28734  None.
28735  Parameters:
28736  None.
28737  Returns
28738  None.
28739 
28740  Remarks
28741  None.
28742 
28743  Example:
28744  ExecuteSystem()
28745  */
28746 
28747 static void
28748  Execute_System ( void ) ;
28749  /* COMMANDS_H */
28750 /***************************************************************************************
28751  End of File
28752  */
28753 
28754 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commands.h*/
28755 /* CLOSE_FILE Include File */
28756 
28757 #include "../system_config.h"
28758 #include "../system_definitions.h"
28759 /**************************************************************************************/
28760 /**************************************************************************************/
28761 /* Section: Structure Data and Local Variables */
28762 /**************************************************************************************/
28763 /**************************************************************************************/
28764 /* SWITCH and SW_COM Data
28765  Summary:
28766  These structures hold required data.
28767  Description:
28768  These structures hold required data. These are here to link these
28769  structures for use by the local functions.
28770 
28771  Remarks:
28772  These are defined in switches.h
28773 */
28774 
28777 
28778 static SWITCH_STATES
28780 
28783 /**************************************************************************************/
28784 /**************************************************************************************/
28785 /* Section: State Machine Functions */
28786 /**************************************************************************************/
28787 /**************************************************************************************/
28788 /***************************************************************************************
28789  Function:
28790  void SWITCH_Tasks ( void )
28791  Summary:
28792  This routine is the SWITCH_tasks function. It defines the (SWITCH) state machine
28793  and core logic.
28794  Remarks:
28795  Refer to the switches.h interface header for function usage details.
28796  */
28797 
28798 void
28799  SWITCH_Tasks ( void ) /* SWITCH state machine.*/
28800  {
28801  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 28))); /* 37 */
28802  switch (
28803  ( ( int )( /* 29 */
28804  SWITCH.state
28805  ))*
28806  ((bitmapstruct.element1 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 29) : 0)), 1 ) /* 19 */
28807  ) /* Check the machines current state.*/
28808  {
28809  case SWITCH_STATE_INIT :
28810  ((bitmapstruct.element1 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 30) : 0)), 1 ); /* 41 */
28811  /* This machines initial state.*/
28812  {
28813  ( void ) memset ( SWITCH.knob_switch_S3 , 0 , 5 ) ;/* Initialize switch S3 values to 0.*/
28814  ( void ) memset ( SWITCH.key_switch_S6 , 0 , 3 ) ;/* Initialize switch S6 values to 0.*/
28815  ( void ) memset ( SWITCH.pol_switch_S4 , 0 , 2 ) ;/* Initialize switch S4 values to 0.*/
28816  ( void ) memset ( SWITCH.fire_switch_S1 , 0 , 2 ) ;/* Initialize switch S1 values to 0.*/
28817  SWITCH.dump_fire_switch_S7 = 0U ; /* Initialize switch S7 value to 0.*/
28818  SWITCH.hvps_switch_S5 = 0U ; /* Initialize switch S5 value to 0.*/
28819  SWITCH.S3_flag = 1 ; /* Flag to show knob switch S3 has not been read.*/
28820  SWITCH.S6_flag = 1 ; /* Flag to show knob switch S3 has not been read.*/
28821  SWITCH.S4_flag = 1 ; /* Flag to show knob switch S4 has not been read.*/
28822  SWITCH.S1_flag = 1 ; /* Flag to show knob switch S1 has not been read.*/
28823  SW_COM.dmpfire_flag = false ; /* Set the flag to show the dump fire button has not been pressed.*/
28824  SW_COM.dmpled_tick = false ; /* Set the dmpled timer tick to false.*/
28825  SWITCH.dump_fire_count = 0U ; /* Initialize counter to track number of dmpled button pushes.*/
28826  SWITCH.debounce_flag = true ; /* dmpled switch debounce completion.*/
28827  SWITCH.debounce_tick = false ; /* dmpled switch debounce timer tick.*/
28828  SWITCH.read_try = 0U ; /* The number of attempts to read a switch.*/
28829  SWITCH.state = SWITCH_STATE_READ ; /* Move on to read the switch positions.*/
28830  }
28831  ((int)(bitmapstruct.element1 |= (1 << 31))); /* 16 */
28832  goto l128620 ;
28833  case SWITCH_STATE_READ :
28834  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 0) : 0)), 1 ); /* 41 */
28835  /* Determine the switch positions.*/
28836  {
28837  ((int)(bitmapstruct.element2 |= (1 << 1))); /* 23 */
28838 
28839  read_switches () ; /* Function to determine the switch positions.*/
28840  SWITCH.state = SWITCH_STATE_PROCESS ; /* Move on to process the switches.*/
28841  }
28842  ((int)(bitmapstruct.element2 |= (1 << 2))); /* 16 */
28843  goto l128620 ;
28844  case SWITCH_STATE_PROCESS :
28845  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 3) : 0)), 1 ); /* 41 */
28846  /* Convert the switch positions into commands.*/
28847  {
28848  ((int)(bitmapstruct.element2 |= (1 << 4))); /* 23 */
28849 
28850  process_switches () ; /* Function to determine switch commands.*/
28851  SWITCH.state = SWITCH_STATE_EXECUTE ; /* Move on to execute the switch commands.*/
28852  }
28853  ((int)(bitmapstruct.element2 |= (1 << 5))); /* 16 */
28854  goto l128620 ;
28855  case SWITCH_STATE_EXECUTE :
28856  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 6) : 0)), 1 ); /* 41 */
28857  /* Execute the switch commands.*/
28858  {
28859  ((int)(bitmapstruct.element2 |= (1 << 7))); /* 23 */
28860 
28861  execute_switches () ; /* Function to execute switch commands.*/
28862  SWITCH.state = SWITCH_STATE_STORE ; /* Move on to store switch positions.*/
28863  }
28864  ((int)(bitmapstruct.element2 |= (1 << 8))); /* 16 */
28865  goto l128620 ;
28866  case SWITCH_STATE_STORE :
28867  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 9) : 0)), 1 ); /* 41 */
28868  /* Store the current switch position.*/
28869  {
28870  ((int)(bitmapstruct.element2 |= (1 << 10))); /* 23 */
28871 
28872  store_switches () ; /* Function to store the switch positions for transmission back to a host.*/
28873  SWITCH.state = SWITCH_STATE_IDLE ; /* Move on to idle to reset flags.*/
28874  }
28875  ((int)(bitmapstruct.element2 |= (1 << 11))); /* 16 */
28876  goto l128620 ;
28877  case SWITCH_STATE_IDLE :
28878  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 12) : 0)), 1 ); /* 41 */
28879  {
28880  SWITCH.S3_flag = 1 ; /* Flag to show knob switch S3 has not been read.*/
28881  SWITCH.S6_flag = 1 ; /* Flag to show knob switch S3 has not been read.*/
28882  SWITCH.S4_flag = 1 ; /* Flag to show knob switch S4 has not been read.*/
28883  SWITCH.S1_flag = 1 ; /* Flag to show knob switch S1 has not been read.*/
28885  }
28886  ((int)(bitmapstruct.element2 |= (1 << 13))); /* 16 */
28887  goto l128620 ;
28888  default :
28889  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 14) : 0)), 1 ); /* 41 */
28890  {
28891  }
28892  ((int)(bitmapstruct.element2 |= (1 << 15))); /* 16 */
28893  goto l128620 ;
28894  }
28895 l128620 :
28896  ; /* 18 */
28897  ((int)(bitmapstruct.element2 |= (1 << 16))); /* 30 */
28898  switches_57zqendz ( 81 ) ; /* 30 */
28899  }
28900 /**************************************************************************************/
28901 /**************************************************************************************/
28902 /* Section: Local Functions */
28903 /**************************************************************************************/
28904 /**************************************************************************************/
28905 /*!*************************************************************************************
28906  Function:
28907  static void read_switches(void)
28908  Summary:
28909  This function determines all of the switch positions.
28910  Remarks:
28911  Refer to the switches.h interface header for function usage details.
28912  */
28913 
28914 static void
28915  read_switches ( void )
28916  {
28917  int izzqqzz=((int)(bitmapstruct.element2 |= (1 << 17))); /* 37 */
28918  uint8_t
28919  count = 0 ; /* Placeholder for switch position.*/
28920  uint8_t
28921  S3_SUM = 0 ; /* Initialize switch S3 sum of switch settings to 0.*/
28922  uint8_t
28923  S6_SUM = 0 ; /* Initialize switch S6 sum of switch settings to 0.*/
28924  uint8_t
28925  S4_SUM = 0 ; /* Initialize switch S4 sum of switch settings to 0.*/
28926  uint8_t
28927  S1_SUM = 0 ; /* Initialize switch S1 sum of switch settings to 0.*/
28928  while
28929  (
28930  ( /* 21 */
28931 
28932  ( /* 52 */
28933  (
28934  SWITCH.S3_flag == 1
28935  )
28936  ? (bitmapstruct.element2 |= (1 << 18 ), 1)
28937  : (bitmapstruct.element2 |= (1 << 19 ), 0) ) /* 54 */
28938  &&
28939  ( SWITCH.read_try <= 100U )
28940  ) /* 7 */
28941  ) /* Read the knob switch S3 values.*/
28942  {
28943  { /* 32 */
28944  int zzqqzs = ((int)(bitmapstruct.element2 |= (1 << 20))); /* 32a */
28945  SWITCH.knob_switch_S3[ 0 ] = ! PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_3 ) ;
28946  SWITCH.knob_switch_S3[ 1 ] = ! PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_8 ) ;
28947  SWITCH.knob_switch_S3[ 2 ] = ! PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_2 ) ;
28948  SWITCH.knob_switch_S3[ 3 ] = ! PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_1 ) ;
28949  SWITCH.knob_switch_S3[ 4 ] = ! PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_13 ) ;
28950  while
28951  (
28952  ( /* 21 */
28953  count < 5U
28954  ) /* 7 */
28955  ) /* See if more than one input reads as 'true'.*/
28956  {
28957  { /* 32 */
28958  int zzqqzs = ((int)(bitmapstruct.element2 |= (1 << 21))); /* 32a */
28959  S3_SUM = S3_SUM + SWITCH.knob_switch_S3[ count ] ;/* Add the inputs together. Result should be = 1 for one*/
28960  count ++ ;/* good input.*/
28961  ((int)(bitmapstruct.element2 |= (1 << 22))); /* 6 */
28962  }
28963  }
28964  ((int)(bitmapstruct.element2 |= (1 << 23))); /* 5 */
28965  if
28966  (
28967  S3_SUM == 1U
28968  )
28969  {
28970  ((int)(bitmapstruct.element2 |= (1 << 24))); /* 1 */
28971  {
28972  SWITCH.S3_flag = 0 ;/* Clear flag to show only one input is true.*/
28973  }
28974  } else ((int)(bitmapstruct.element2 |= (1 << 25))); /* 4 */
28975  S3_SUM = 0U ;/* Reset values when we need to read switch again.*/
28976  count = 0U ;
28977  SWITCH.read_try = SWITCH.read_try + 1U ;/* Increment switch try counter.*/
28978  ((int)(bitmapstruct.element2 |= (1 << 26))); /* 6 */
28979  }
28980  }
28981  ((int)(bitmapstruct.element2 |= (1 << 27))); /* 5 */
28982  SWITCH.read_try = 0U ;/* Reset the read_try count.*/
28983  while
28984  (
28985  ( /* 21 */
28986 
28987  ( /* 52 */
28988  (
28989  SWITCH.S6_flag == 1
28990  )
28991  ? (bitmapstruct.element2 |= (1 << 28 ), 1)
28992  : (bitmapstruct.element2 |= (1 << 29 ), 0) ) /* 54 */
28993  &&
28994  ( SWITCH.read_try <= 100U )
28995  ) /* 7 */
28996  ) /* Read the key switch S6 values.*/
28997  {
28998  { /* 32 */
28999  int zzqqzs = ((int)(bitmapstruct.element2 |= (1 << 30))); /* 32a */
29000  SWITCH.key_switch_S6[ 0 ] = ! PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_2 ) ;
29001  SWITCH.key_switch_S6[ 1 ] = ! PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_1 ) ;
29002  SWITCH.key_switch_S6[ 2 ] = ! PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_0 ) ;
29003  while
29004  (
29005  ( /* 21 */
29006  count < 3U
29007  ) /* 7 */
29008  ) /* See if more than one input reads as 'true'.*/
29009  {
29010  { /* 32 */
29011  int zzqqzs = ((int)(bitmapstruct.element2 |= (1 << 31))); /* 32a */
29012  S6_SUM = S6_SUM + SWITCH.key_switch_S6[ count ] ;/* Add the inputs together. Result should be = 1 for one*/
29013  count ++ ;/* good input.*/
29014  ((int)(bitmapstruct.element3 |= (1 << 0))); /* 6 */
29015  }
29016  }
29017  ((int)(bitmapstruct.element3 |= (1 << 1))); /* 5 */
29018  if
29019  (
29020  S6_SUM == 1U
29021  )
29022  {
29023  ((int)(bitmapstruct.element3 |= (1 << 2))); /* 1 */
29024  {
29025  SWITCH.S6_flag = 0 ;/* Clear flag to show only one input is true.*/
29026  }
29027  } else ((int)(bitmapstruct.element3 |= (1 << 3))); /* 4 */
29028  S6_SUM = 0U ;/* Reset values when we we need to read switch again.*/
29029  count = 0U ;
29030  SWITCH.read_try = SWITCH.read_try + 1U ;/* Increment switch try counter.*/
29031  ((int)(bitmapstruct.element3 |= (1 << 4))); /* 6 */
29032  }
29033  }
29034  ((int)(bitmapstruct.element3 |= (1 << 5))); /* 5 */
29035  SWITCH.read_try = 0U ;/* Reset the read_try count.*/
29036  while
29037  (
29038  ( /* 21 */
29039 
29040  ( /* 52 */
29041  (
29042  SWITCH.S4_flag == 1
29043  )
29044  ? (bitmapstruct.element3 |= (1 << 6 ), 1)
29045  : (bitmapstruct.element3 |= (1 << 7 ), 0) ) /* 54 */
29046  &&
29047  ( SWITCH.read_try <= 100U )
29048  ) /* 7 */
29049  ) /* Read the polarity switch S4 values.*/
29050  {
29051  { /* 32 */
29052  int zzqqzs = ((int)(bitmapstruct.element3 |= (1 << 8))); /* 32a */
29053  SWITCH.pol_switch_S4[ 0 ] = ! PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_15 ) ;
29054  SWITCH.pol_switch_S4[ 1 ] = ! PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_4 ) ;
29055  while
29056  (
29057  ( /* 21 */
29058  count < 2U
29059  ) /* 7 */
29060  ) /* See if more than one input reads as 'true'.*/
29061  {
29062  { /* 32 */
29063  int zzqqzs = ((int)(bitmapstruct.element3 |= (1 << 9))); /* 32a */
29064  S4_SUM = S4_SUM + SWITCH.pol_switch_S4[ count ] ;/* Add the inputs together. Result should be = 1 for one*/
29065  count ++ ;/* good input.*/
29066  ((int)(bitmapstruct.element3 |= (1 << 10))); /* 6 */
29067  }
29068  }
29069  ((int)(bitmapstruct.element3 |= (1 << 11))); /* 5 */
29070  if
29071  (
29072  S4_SUM == 1U
29073  )
29074  {
29075  ((int)(bitmapstruct.element3 |= (1 << 12))); /* 1 */
29076  {
29077  SWITCH.S4_flag = 0 ;/* Clear flag to show only one input is true.*/
29078  }
29079  } else ((int)(bitmapstruct.element3 |= (1 << 13))); /* 4 */
29080  S4_SUM = 0U ;/* Reset values when we we need to read switch again.*/
29081  count = 0U ;
29082  SWITCH.read_try = SWITCH.read_try + 1U ;/* Increment switch try counter.*/
29083  ((int)(bitmapstruct.element3 |= (1 << 14))); /* 6 */
29084  }
29085  }
29086  ((int)(bitmapstruct.element3 |= (1 << 15))); /* 5 */
29087  SWITCH.read_try = 0U ;/* Reset the read_try count.*/
29088  while
29089  (
29090  ( /* 21 */
29091 
29092  ( /* 52 */
29093  (
29094  SWITCH.S1_flag == 1
29095  )
29096  ? (bitmapstruct.element3 |= (1 << 16 ), 1)
29097  : (bitmapstruct.element3 |= (1 << 17 ), 0) ) /* 54 */
29098  &&
29099  ( SWITCH.read_try <= 100U )
29100  ) /* 7 */
29101  ) /* Read the fire switch S1 values.*/
29102  {
29103  { /* 32 */
29104  int zzqqzs = ((int)(bitmapstruct.element3 |= (1 << 18))); /* 32a */
29105  SWITCH.fire_switch_S1[ 0 ] = ! PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_8 ) ;
29106  SWITCH.fire_switch_S1[ 1 ] = ! PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_8 ) ;
29107  while
29108  (
29109  ( /* 21 */
29110  count < 2U
29111  ) /* 7 */
29112  ) /* See if more than one input reads as 'true'.*/
29113  {
29114  { /* 32 */
29115  int zzqqzs = ((int)(bitmapstruct.element3 |= (1 << 19))); /* 32a */
29116  S1_SUM = S1_SUM + SWITCH.fire_switch_S1[ count ] ;/* Add the inputs together. Result should be = 1 for one*/
29117  count ++ ;/* good input.*/
29118  ((int)(bitmapstruct.element3 |= (1 << 20))); /* 6 */
29119  }
29120  }
29121  ((int)(bitmapstruct.element3 |= (1 << 21))); /* 5 */
29122  if
29123  (
29124  S1_SUM == 1U
29125  )
29126  {
29127  ((int)(bitmapstruct.element3 |= (1 << 22))); /* 1 */
29128  {
29129  SWITCH.S1_flag = 0 ;/* Clear flag to show only one input is true.*/
29130  }
29131  } else ((int)(bitmapstruct.element3 |= (1 << 23))); /* 4 */
29132  S1_SUM = 0U ;/* Reset values when we we need to read switch again.*/
29133  count = 0u ;
29134  SWITCH.read_try = SWITCH.read_try + 1U ;/* Increment switch try counter.*/
29135  ((int)(bitmapstruct.element3 |= (1 << 24))); /* 6 */
29136  }
29137  }
29138  ((int)(bitmapstruct.element3 |= (1 << 25))); /* 5 */
29139  SWITCH.read_try = 0U ;
29140  /* Reset the read_try count.*/
29141  /* LDRA_INSPECTED 433 S
29142 */ /* Proper values assigned to enumeration.*/
29143  SWITCH.dump_fire_switch_S7 = PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_8 ) ;/* Read the Dump Fire Switch.*/
29144  if
29145  ( /* 50 */
29146  (
29147 
29148  ( /* 52 */
29149  (
29151  )
29152  ? (bitmapstruct.element3 |= (1 << 26 ), 1)
29153  : (bitmapstruct.element3 |= (1 << 27 ), 0) ) /* 54 */
29154  &&
29155  ( SWITCH.debounce_flag == true )
29156  ) /* If the switch has been pushed and the de-bounce flag has been set,*/
29157  ) /* 1 */
29158  {
29159  ((int)(bitmapstruct.element3 |= (1 << 28))); /* 1 */
29160  {
29161  SWITCH.debounce_flag = false ;/* reset the flag and*/
29162  SWITCH.dump_fire_count ++ ;/* increment the number of times the DMP FIRE switch has been pushed.*/
29163  }
29164  } else ((int)(bitmapstruct.element3 |= (1 << 29))); /* 4 */
29165  SWITCH.hvps_switch_S5 = ! PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_5 ) ;/* Read the HVPS control pot switch.*/
29166  ((int)(bitmapstruct.element3 |= (1 << 30))); /* 30 */
29167  switches_57zqendz ( 127 ) ; /* 30 */
29168  }
29169 /*!*************************************************************************************
29170  Function:
29171  static void process_switches(void)
29172  Summary:
29173  This function converts the front panel switch positions into commands.
29174  Remarks:
29175  Refer to the switches.h interface header for function usage details.
29176  */
29177 
29178 static void
29180  {
29181  int izzqqzz=((int)(bitmapstruct.element3 |= (1 << 31))); /* 37 */
29182  uint8_t
29183  count = 0U ; /* Used to convert a switch position to a command.*/
29184  while
29185  (
29186  ( /* 21 */
29187  count < 5U
29188  ) /* 7 */
29189  ) /* Convert the S3 switch position to a command.*/
29190  {
29191  { /* 32 */
29192  int zzqqzs = ((int)(bitmapstruct.element4 |= (1 << 0))); /* 32a */
29193  if
29194  (
29195  SWITCH.knob_switch_S3[ count ] == 1U
29196  )
29197  {
29198  ((int)(bitmapstruct.element4 |= (1 << 1))); /* 1 */
29199  {
29200  /* LDRA_INSPECTED 93 S
29201 */
29202  /* LDRA_INSPECTED 411 S
29203 */ /* Proper values assigned to enumeration.*/
29204  SW_COM.S3_state = ( int8_t ) count ;/* Assign a switch S3 command based on the switch position.*/
29205  }
29206  } else ((int)(bitmapstruct.element4 |= (1 << 2))); /* 4 */
29207  count ++ ;
29208  ((int)(bitmapstruct.element4 |= (1 << 3))); /* 6 */
29209  }
29210  }
29211  ((int)(bitmapstruct.element4 |= (1 << 4))); /* 5 */
29212  count = 0U ;/* Reset the counter.*/
29213  while
29214  (
29215  ( /* 21 */
29216  count < 2U
29217  ) /* 7 */
29218  ) /* Convert the S4 polarity position to a command.*/
29219  {
29220  { /* 32 */
29221  int zzqqzs = ((int)(bitmapstruct.element4 |= (1 << 5))); /* 32a */
29222  if
29223  (
29224  SWITCH.pol_switch_S4[ count ] == 1U
29225  )
29226  {
29227  ((int)(bitmapstruct.element4 |= (1 << 6))); /* 1 */
29228  {
29229  /* LDRA_INSPECTED 93 S
29230 */
29231  /* LDRA_INSPECTED 411 S
29232 */ /* Proper values assigned to enumeration.*/
29233  SW_COM.S4_state = ( int8_t ) count ;/* Assign a switch S4 command based on the switch position.*/
29234  }
29235  } else ((int)(bitmapstruct.element4 |= (1 << 7))); /* 4 */
29236  count ++ ;
29237  ((int)(bitmapstruct.element4 |= (1 << 8))); /* 6 */
29238  }
29239  }
29240  ((int)(bitmapstruct.element4 |= (1 << 9))); /* 5 */
29241  count = 0U ;/* Reset the count value.*/
29242  while
29243  (
29244  ( /* 21 */
29245  count < 2U
29246  ) /* 7 */
29247  ) /* Convert the S1 fire position to a command.*/
29248  {
29249  { /* 32 */
29250  int zzqqzs = ((int)(bitmapstruct.element4 |= (1 << 10))); /* 32a */
29251  if
29252  (
29253  SWITCH.fire_switch_S1[ count ] == 1U
29254  )
29255  {
29256  ((int)(bitmapstruct.element4 |= (1 << 11))); /* 1 */
29257  {
29258  /* LDRA_INSPECTED 93 S
29259 */
29260  /* LDRA_INSPECTED 411 S
29261 */ /* Proper values assigned to enumeration.*/
29262  SW_COM.S1_state = ( int8_t ) count ;/* Assign a switch S1 command based on the switch position.*/
29263  }
29264  } else ((int)(bitmapstruct.element4 |= (1 << 12))); /* 4 */
29265  count ++ ;
29266  ((int)(bitmapstruct.element4 |= (1 << 13))); /* 6 */
29267  }
29268  }
29269  ((int)(bitmapstruct.element4 |= (1 << 14))); /* 5 */
29270  /* LDRA_INSPECTED 93 S
29271 */
29272  /* LDRA_INSPECTED 411 S
29273 */ /* Proper values assigned to enumeration.*/
29274  SW_COM.S7_state = ( int8_t ) SWITCH.dump_fire_count ;
29275  /* Set the switch state to the number of times the switch has been pushed.*/
29276  /* LDRA_INSPECTED 93 S
29277 */
29278  /* LDRA_INSPECTED 411 S
29279 */ /* Proper values assigned to enumeration.*/
29280  SW_COM.S5_state = ( int8_t ) SWITCH.hvps_switch_S5 ;
29281  ((int)(bitmapstruct.element4 |= (1 << 15))); /* 30 */
29282  switches_57zqendz ( 144 ) ; /* 30 */
29283  }
29284 /*!*************************************************************************************
29285  Function:
29286  static void execute_switches(void)
29287  Summary:
29288  This function actuates relays based on the front panel switch position.
29289  Remarks:
29290  Refer to the switches.h interface header for function usage details.
29291  */
29292 
29293 static void
29295  {
29296  int izzqqzz=((int)(bitmapstruct.element4 |= (1 << 16))); /* 37 */
29297  switch (
29298  ( ( int )( /* 29 */
29300  ))*
29301  ((bitmapstruct.element4 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 17) : 0)), 1 ) /* 19 */
29302  ) /* Knob switch command.*/
29303  {
29304  case RLY_LOG :
29305  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 18) : 0)), 1 ); /* 41 */
29306  /* Knob switch is in the LOG position.*/
29307  {
29308  if
29309  (
29310  SWITCH.key_switch_S6[ 1 ] == 0U
29311  ) /* If key switch S6 is not in the safe position,*/
29312  {
29313  ((int)(bitmapstruct.element4 |= (1 << 19))); /* 1 */
29314  {
29315  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 ) ;/* Turn on the LOG relay.*/
29316  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 ) ;/* Turn off the AUX relay.*/
29317  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 ) ;/* Turn off the ARM relay.*/
29318  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 ) ;/* Turn off the ARM_CF relay.*/
29319  SET_WL_SPS_IOffset ( 0x03U ) ; /* Added to compensate offset.*/
29320  }
29321  ((int)(bitmapstruct.element4 |= (1 << 20))); /* 3 */
29322  }
29323  else /* The key switch is in the safe position,*/
29324  {
29325  ((int)(bitmapstruct.element4 |= (1 << 21))); /* 2 */
29326  { /* turn all of the relays off.*/
29327  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 ) ;/* Turn off the LOG relay.*/
29328  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 ) ;/* Turn off the AUX relay.*/
29329  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 ) ;/* Turn off the ARM relay.*/
29330  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 ) ;/* Turn off the ARM_CF relay.*/
29331  }
29332  }
29333  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 ) ;/* Turn WL_CPS off.*/
29334  }
29335  ((int)(bitmapstruct.element4 |= (1 << 22))); /* 16 */
29336  goto l129013 ;
29337  case RLY_AUX :
29338  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 23) : 0)), 1 ); /* 41 */
29339  /* Knob switch is in the AUX position.*/
29340  {
29341  if
29342  (
29343  SWITCH.key_switch_S6[ 1 ] == 0U
29344  ) /* If key switch S6 is not in the safe position,*/
29345  {
29346  ((int)(bitmapstruct.element4 |= (1 << 24))); /* 1 */
29347  {
29348  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 ) ;/* Turn off the LOG relay.*/
29349  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 ) ;/* Turn on the AUX relay.*/
29350  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 ) ;/* Turn off the ARM relay.*/
29351  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 ) ;/* Turn off the ARM_CF relay.*/
29352  SET_WL_SPS_IOffset ( 0x03U ) ; /* Added to compensate offset.*/
29353  }
29354  ((int)(bitmapstruct.element4 |= (1 << 25))); /* 3 */
29355  }
29356  else /* The key switch is in the safe position,*/
29357  {
29358  ((int)(bitmapstruct.element4 |= (1 << 26))); /* 2 */
29359  { /* turn all of the relays off.*/
29360  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 ) ;/* Turn off the LOG relay.*/
29361  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 ) ;/* Turn off the AUX relay.*/
29362  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 ) ;/* Turn off the ARM relay.*/
29363  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 ) ;/* Turn off the ARM_CF relay.*/
29364  }
29365  }
29366  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 ) ;/* Turn WL_CPS off.*/
29367  }
29368  ((int)(bitmapstruct.element4 |= (1 << 27))); /* 16 */
29369  goto l129013 ;
29370  case RLY_ARM :
29371  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 28) : 0)), 1 ); /* 41 */
29372  /* Knob switch is in the ARM position.*/
29373  {
29374  if
29375  (
29376  SWITCH.key_switch_S6[ 1 ] == 0U
29377  ) /* If key switch S6 is not in the safe position,*/
29378  {
29379  ((int)(bitmapstruct.element4 |= (1 << 29))); /* 1 */
29380  {
29381  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 ) ;/* Turn off the LOG relay.*/
29382  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 ) ;/* Turn off the AUX relay.*/
29383  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 ) ;/* Turn on the ARM relay to connect the HVPS to the wire-line.*/
29384  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 ) ;/* Turn off the ARM_CF relay.*/
29385  }
29386  ((int)(bitmapstruct.element4 |= (1 << 30))); /* 3 */
29387  }
29388  else /* The key switch is in the safe position,*/
29389  {
29390  ((int)(bitmapstruct.element4 |= (1 << 31))); /* 2 */
29391  { /* turn all of the relays off.*/
29392  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 ) ;/* Turn off the LOG relay.*/
29393  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 ) ;/* Turn off the AUX relay.*/
29394  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 ) ;/* Turn off the ARM relay.*/
29395  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 ) ;/* Turn off the ARM_CF relay.*/
29396  }
29397  }
29398  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 ) ;/* Turn WL_CPS off.*/
29399  }
29400  ((int)(bitmapstruct.element5 |= (1 << 0))); /* 16 */
29401  goto l129013 ;
29402  case RLY_ARM_CF :
29403  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 1) : 0)), 1 ); /* 41 */
29404  /* Knob switch is in the ARM_CF position.*/
29405  {
29406  if
29407  (
29408  SWITCH.key_switch_S6[ 1 ] == 0U
29409  ) /* If key switch S6 is not in the safe position,*/
29410  {
29411  ((int)(bitmapstruct.element5 |= (1 << 2))); /* 1 */
29412  {
29413  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 ) ;/* Turn off the LOG relay.*/
29414  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 ) ;/* Turn off the AUX relay.*/
29415  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 ) ;/* Turn off the ARM relay.*/
29416  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 ) ;/* Turn on the ARMCF relay.*/
29417  SET_WL_SPS_IOffset ( 0x02U ) ; /* Added to compensate offset.*/
29418  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 ) ;/* Turn on the Wire-line relay to connect the HVPS to the wire-line.*/
29419  }
29420  ((int)(bitmapstruct.element5 |= (1 << 3))); /* 3 */
29421  }
29422  else /* The key switch is in the safe position,*/
29423  {
29424  ((int)(bitmapstruct.element5 |= (1 << 4))); /* 2 */
29425  { /* turn all of the relays off.*/
29426  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 ) ;/* Turn off the LOG relay.*/
29427  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 ) ;/* Turn off the AUX relay.*/
29428  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 ) ;/* Turn off the ARM relay.*/
29429  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 ) ;/* Turn off the ARM_CF relay.*/
29430  }
29431  }
29432  }
29433  ((int)(bitmapstruct.element5 |= (1 << 5))); /* 16 */
29434  goto l129013 ;
29435  case RLY_ARM_CF_AUTO :
29436  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 6) : 0)), 1 ); /* 41 */
29437  {
29438  if
29439  (
29440  SWITCH.key_switch_S6[ 1 ] == 0U
29441  ) /* If key switch S6 is not in the safe position,*/
29442  {
29443  ((int)(bitmapstruct.element5 |= (1 << 7))); /* 1 */
29444  {
29445  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 ) ;/* Turn off the LOG relay.*/
29446  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 ) ;/* Turn off the AUX relay.*/
29447  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 ) ;/* Turn off the ARM relay.*/
29448  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 ) ;/* Turn on the ARMCF relay.*/
29449  }
29450  ((int)(bitmapstruct.element5 |= (1 << 8))); /* 3 */
29451  }
29452  else /* The key switch is in the safe position,*/
29453  {
29454  ((int)(bitmapstruct.element5 |= (1 << 9))); /* 2 */
29455  { /* turn all of the relays off.*/
29456  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 ) ;/* Turn off the LOG relay.*/
29457  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 ) ;/* Turn off the AUX relay.*/
29458  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 ) ;/* Turn off the ARM relay.*/
29459  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 ) ;/* Turn off the ARM_CF relay.*/
29460  }
29461  }
29462  }
29463  ((int)(bitmapstruct.element5 |= (1 << 10))); /* 16 */
29464  goto l129013 ;
29465  default :
29466  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 11) : 0)), 1 ); /* 41 */
29467  {
29468  }
29469  ((int)(bitmapstruct.element5 |= (1 << 12))); /* 16 */
29470  goto l129013 ;
29471  }
29472 l129013 :
29473  ; /* 18 */
29474  switch (
29475  ( ( int )( /* 29 */
29477  ))*
29478  ((bitmapstruct.element5 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 13) : 0)), 1 ) /* 19 */
29479  ) /* WL_SPS Polarity Switch Command.*/
29480  {
29481  case POS_POL :
29482  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 14) : 0)), 1 ); /* 41 */
29483  {
29484  if
29485  ( /* 50 */
29486  (
29487 
29488  ( /* 51 */
29489  (
29491  )
29492  ? (bitmapstruct.element5 |= (1 << 16 ), 1)
29493  : (bitmapstruct.element5 |= (1 << 15 ), 0) ) /* 54 */
29494  ||
29496  ) /* Positive voltages not allow in ARM_CF or AUTO_ARM_CF. Set the*/
29497  ) /* 1 */
29498  {
29499  ((int)(bitmapstruct.element5 |= (1 << 17))); /* 1 */
29500  { /* polarity relay to negative output.*/
29501  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 ) ;/* Turn polarity relay on to set HVPS output for negative voltage.*/
29502  if
29503  ( /* 50 */
29504  (
29505 
29506  ( /* 52 */
29507  (
29508  PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_12 ) == 0
29509  )
29510  ? (bitmapstruct.element5 |= (1 << 18 ), 1)
29511  : (bitmapstruct.element5 |= (1 << 19 ), 0) ) /* 54 */
29512  &&
29513  (
29514  PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_13 ) == 1 )
29515  ) /* If the polarity detection circuitry has detected these settings,*/
29516  ) /* 1 */
29517  {
29518  ((int)(bitmapstruct.element5 |= (1 << 20))); /* 1 */
29519  {
29520  Set_Status ( 5 ) ;/* Negative voltage detected.*/
29521  Clear_Status ( 6 ) ;/* Positive voltage not detected.*/
29522  }
29523  } else ((int)(bitmapstruct.element5 |= (1 << 21))); /* 4 */
29524  }
29525  ((int)(bitmapstruct.element5 |= (1 << 22))); /* 3 */
29526  }
29527  else /* For all other knob positions,*/
29528  {
29529  ((int)(bitmapstruct.element5 |= (1 << 23))); /* 2 */
29530  {
29531  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 ) ;/* Positive Polarity is the default 'off' position.*/
29532  if
29533  ( /* 50 */
29534  (
29535 
29536  ( /* 52 */
29537  (
29538  PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_12 ) == 1
29539  )
29540  ? (bitmapstruct.element5 |= (1 << 24 ), 1)
29541  : (bitmapstruct.element5 |= (1 << 25 ), 0) ) /* 54 */
29542  &&
29543  (
29544  PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_13 ) == 0 )
29545  ) /* If the polarity detection circuitry has detected these settings,*/
29546  ) /* 1 */
29547  {
29548  ((int)(bitmapstruct.element5 |= (1 << 26))); /* 1 */
29549  {
29550  Clear_Status ( 5 ) ;/* Negative voltage not detected.*/
29551  Set_Status ( 6 ) ;/* Positive voltage detected.*/
29552  }
29553  } else ((int)(bitmapstruct.element5 |= (1 << 27))); /* 4 */
29554  }
29555  }
29556  }
29557  ((int)(bitmapstruct.element5 |= (1 << 28))); /* 16 */
29558  goto l129086 ;
29559  case NEG_POL :
29560  ((bitmapstruct.element5 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 29) : 0)), 1 ); /* 41 */
29561  {
29562  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 ) ;/* Turn polarity relay on to set HVPS output for negative voltage.*/
29563  if
29564  ( /* 50 */
29565  (
29566 
29567  ( /* 52 */
29568  (
29569  PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_12 ) == 0
29570  )
29571  ? (bitmapstruct.element5 |= (1 << 30 ), 1)
29572  : (bitmapstruct.element5 |= (1 << 31 ), 0) ) /* 54 */
29573  &&
29574  (
29575  PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_13 ) == 1 )
29576  ) /* If the polarity detection circuitry has detected these settings,*/
29577  ) /* 1 */
29578  {
29579  ((int)(bitmapstruct.element6 |= (1 << 0))); /* 1 */
29580  {
29581  Set_Status ( 5 ) ;/* Negative voltage detected.*/
29582  Clear_Status ( 6 ) ;/* Positive voltage not detected.*/
29583  }
29584  } else ((int)(bitmapstruct.element6 |= (1 << 1))); /* 4 */
29585  }
29586  ((int)(bitmapstruct.element6 |= (1 << 2))); /* 16 */
29587  goto l129086 ;
29588  default :
29589  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 3) : 0)), 1 ); /* 41 */
29590  {
29591  /*Comment*/
29592  }
29593  ((int)(bitmapstruct.element6 |= (1 << 4))); /* 16 */
29594  goto l129086 ;
29595  }
29596 l129086 :
29597  ; /* 18 */
29598  switch (
29599  ( ( int )( /* 29 */
29601  ))*
29602  ((bitmapstruct.element6 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 5) : 0)), 1 ) /* 19 */
29603  ) /* Dump Fire Switch Command.*/
29604  {
29605  case RLY_NO_DUMP :
29606  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 6) : 0)), 1 ); /* 41 */
29607  /* The DMPFIRE button has not been pressed.*/
29608  { /* No action occurs here.*/
29609  SWITCH.debounce_tick = false ; /* Reset the DMPFIRE switch de-bounce timer tick.*/
29610  }
29611  ((int)(bitmapstruct.element6 |= (1 << 7))); /* 16 */
29612  goto l129162 ;
29613  case RLY_DUMP_START :
29614  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 8) : 0)), 1 ); /* 41 */
29615  /* The DMPFIRE switch has been pressed once.*/
29616  {
29617  SW_COM.dmpfire_flag = true ; /* Flag to indicate a dump fire sequence has been started.*/
29618  if
29619  ( /* 50 */
29620  (
29621 
29622  ( /* 52 */
29623  (
29624  GetDepthStatus () == true
29625  )
29626  ? (bitmapstruct.element6 |= (1 << 9 ), 1)
29627  : (bitmapstruct.element6 |= (1 << 10 ), 0) ) /* 54 */
29628  &&
29629 
29630  ( /* 52 */
29631  (
29633  ) /* If we are at the proper depth, the fire switch has been pulled,*/
29634  ? (bitmapstruct.element6 |= (1 << 11 ), 1)
29635  : (bitmapstruct.element6 |= (1 << 12 ), 0) ) /* 54 */
29636  &&
29637 
29638  ( /* 52 */
29639  (
29641  )
29642  ? (bitmapstruct.element6 |= (1 << 13 ), 1)
29643  : (bitmapstruct.element6 |= (1 << 14 ), 0) ) /* 54 */
29644  &&
29645  ( SWITCH.key_switch_S6[ 1 ] == 0U )
29646  )
29647  ) /* 1 */
29648  {
29649  ((int)(bitmapstruct.element6 |= (1 << 15))); /* 1 */
29650  /* the knob switch S3 is in the ARM position and the key switch S6 is not*/
29651  /* in the safe position, then we can complete the DMPFIRE sequence.*/
29652  {
29653  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 ) ;/* Turn the HV_PS relay on.*/
29654  if
29655  (
29656  SWITCH.debounce_tick == true
29657  ) /* If the DMP_FIRE de-bounce timer has completed,*/
29658  {
29659  ((int)(bitmapstruct.element6 |= (1 << 16))); /* 1 */
29660  {
29661  SWITCH.debounce_flag = true ; /* set the flag to indicate that the de-bounce timer has completed.*/
29662  SWITCH.debounce_tick = false ; /* Reset the timer tick.*/
29663  }
29664  } else ((int)(bitmapstruct.element6 |= (1 << 17))); /* 4 */
29665  }
29666  } else ((int)(bitmapstruct.element6 |= (1 << 18))); /* 4 */
29667  if
29668  (
29669  SW_COM.dmpled_tick == true
29670  ) /* If the 1000mS DMPLED_tick has been set true in timers.c.*/
29671  {
29672  ((int)(bitmapstruct.element6 |= (1 << 19))); /* 1 */
29673  {
29674  PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 ) ;/* Toggle the DMP_FIRE_LED and*/
29675  SW_COM.dmpled_tick = false ; /* reset the DMPLED timer tick.*/
29676  }
29677  } else ((int)(bitmapstruct.element6 |= (1 << 20))); /* 4 */
29678  }
29679  ((int)(bitmapstruct.element6 |= (1 << 21))); /* 16 */
29680  goto l129162 ;
29681  case RLY_DUMP_FINISH :
29682  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 22) : 0)), 1 ); /* 41 */
29683  /* The DMP_FIRE switch has been pressed a second time.*/
29684  {
29685  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 ) ;/* Turn the DUMP_FIRE relay on.*/
29686  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 ) ;/* Turn the DMP_FIRE_LED off.*/
29687  if
29688  (
29689  SWITCH.debounce_tick == true
29690  ) /* If the DMPFIRE de-bounce timer has completed,*/
29691  {
29692  ((int)(bitmapstruct.element6 |= (1 << 23))); /* 1 */
29693  {
29694  SWITCH.debounce_flag = true ; /* set the flag to indicate that the de-bounce timer has completed.*/
29695  SWITCH.debounce_tick = false ; /* Reset the timer tick.*/
29696  SW_COM.dmpfire_flag = false ; /* Reset he DMP_FIRE sequence started flag.*/
29697  SWITCH.dump_fire_count = 0U ; /* Reset the count.*/
29698  }
29699  } else ((int)(bitmapstruct.element6 |= (1 << 24))); /* 4 */
29700  }
29701  ((int)(bitmapstruct.element6 |= (1 << 25))); /* 16 */
29702  goto l129162 ;
29703  default :
29704  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 26) : 0)), 1 ); /* 41 */
29705  {
29706  /*Comment*/
29707  }
29708  ((int)(bitmapstruct.element6 |= (1 << 27))); /* 16 */
29709  goto l129162 ;
29710  }
29711 l129162 :
29712  ; /* 18 */
29713  switch (
29714  ( ( int )( /* 29 */
29716  ))*
29717  ((bitmapstruct.element6 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 28) : 0)), 1 ) /* 19 */
29718  ) /* Fire Switch Command.*/
29719  {
29720  case RLY_NO_FIRE :
29721  ((bitmapstruct.element6 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 29) : 0)), 1 ); /* 41 */
29722  /* The fire switch is not actuated.*/
29723  {
29724  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 ) ;/* Turn the HV_PS relay off.*/
29725  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 ) ;/* Turn the DUMP FIRE relay off.*/
29726  if
29727  (
29729  ) /* If the S3 switch is not in ARMCF position,*/
29730  {
29731  ((int)(bitmapstruct.element6 |= (1 << 30))); /* 1 */
29732  {
29733  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 ) ;/* Turn off the Wire-line relay to disconnect the HVPS from the wire-line.*/
29734  }
29735  } else ((int)(bitmapstruct.element6 |= (1 << 31))); /* 4 */
29736  if
29737  (
29738  WL_SPS.voltage < 2U
29739  ) /* If the wire-line voltage is less than 2V,*/
29740  {
29741  ((int)(bitmapstruct.element7 |= (1 << 0))); /* 1 */
29742  {
29743  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 ) ;/* turn on the CCL relay. Send signal to the CCL board.*/
29744  }
29745  ((int)(bitmapstruct.element7 |= (1 << 1))); /* 3 */
29746  }
29747  else /* Otherwise,*/
29748  {
29749  ((int)(bitmapstruct.element7 |= (1 << 2))); /* 2 */
29750  {
29751  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 ) ;/* turn off the CCL relay. No signal to the CCL board.*/
29752  }
29753  }
29754  }
29755  ((int)(bitmapstruct.element7 |= (1 << 3))); /* 16 */
29756  goto l129232 ;
29757  case RLY_FIRE :
29758  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 4) : 0)), 1 ); /* 41 */
29759  /* The fire switch is actuated.*/
29760  {
29761  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 ) ;/* Open this relay when communications with PerfSwitch are complete.*/
29762  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 ) ;/* Turn off the CCL relay. No signal to the CCL board.*/
29763  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 ) ;/* Turn on the Wire-line relay to connect the HVPS to the wire-line.*/
29764  if
29765  ( /* 50 */
29766  (
29767 
29768  ( /* 51 */
29769  (
29771  )
29772  ? (bitmapstruct.element7 |= (1 << 6 ), 1)
29773  : (bitmapstruct.element7 |= (1 << 5 ), 0) ) /* 54 */
29774  ||
29775  ( SW_COM.S3_state != RLY_AUX )
29776  ) /* If the S3 switch is not in the LOG or AUX state and*/
29777  ) /* 1 */
29778  {
29779  ((int)(bitmapstruct.element7 |= (1 << 7))); /* 1 */
29780  {
29781  if
29782  ( /* 50 */
29783  (
29784 
29785  ( /* 52 */
29786  (
29787  SWITCH.key_switch_S6[ 1 ] == 0U
29788  )
29789  ? (bitmapstruct.element7 |= (1 << 8 ), 1)
29790  : (bitmapstruct.element7 |= (1 << 9 ), 0) ) /* 54 */
29791  &&
29792 
29793  ( /* 52 */
29794  (
29795  GetDepthStatus (
29796  ) == true
29797  )
29798  ? (bitmapstruct.element7 |= (1 << 10 ), 1)
29799  : (bitmapstruct.element7 |= (1 << 11 ), 0) ) /* 54 */
29800  &&
29801  ( SW_COM.dmpfire_flag == false )
29802  ) /* and a DMPFIRE sequence has not been started,*/
29803  ) /* 1 */
29804  {
29805  ((int)(bitmapstruct.element7 |= (1 << 12))); /* 1 */
29806  {
29807  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 ) ;/* Turn the HV_PS relay on.*/
29808  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 ) ;/* Turn the DUMP FIRE relay on.*/
29809  }
29810  } else ((int)(bitmapstruct.element7 |= (1 << 13))); /* 4 */
29811  }
29812  } else ((int)(bitmapstruct.element7 |= (1 << 14))); /* 4 */
29813  }
29814  ((int)(bitmapstruct.element7 |= (1 << 15))); /* 16 */
29815  goto l129232 ;
29816  default :
29817  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 16) : 0)), 1 ); /* 41 */
29818  {
29819  /*Comment*/
29820  }
29821  ((int)(bitmapstruct.element7 |= (1 << 17))); /* 16 */
29822  goto l129232 ;
29823  }
29824 l129232 :
29825  ; /* 18 */
29826  switch (
29827  ( ( int )( /* 29 */
29829  ))*
29830  ((bitmapstruct.element7 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 18) : 0)), 1 ) /* 19 */
29831  ) /* HV_PS Control Pot command.*/
29832  {
29833  case HVPS_OFF :
29834  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 19) : 0)), 1 ); /* 41 */
29835  {
29836  HV_PS.pot_switch = false ; /* HV_PS control pot does not need to be read.*/
29837  }
29838  ((int)(bitmapstruct.element7 |= (1 << 20))); /* 16 */
29839  goto l129252 ;
29840  case HVPS_ON :
29841  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 21) : 0)), 1 ); /* 41 */
29842  {
29843  HV_PS.pot_switch = true ; /* Can go ahead and read HV_PS control pot.*/
29844  }
29845  ((int)(bitmapstruct.element7 |= (1 << 22))); /* 16 */
29846  goto l129252 ;
29847  default :
29848  ((bitmapstruct.element7 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 23) : 0)), 1 ); /* 41 */
29849  {
29850  /*Comment*/
29851  }
29852  ((int)(bitmapstruct.element7 |= (1 << 24))); /* 16 */
29853  goto l129252 ;
29854  }
29855 l129252 :
29856  ; /* 18 */
29857  ((int)(bitmapstruct.element7 |= (1 << 25))); /* 30 */
29858  switches_57zqendz ( 250 ) ; /* 30 */
29859  }
29860 /*!*************************************************************************************
29861  Function:
29862  static void store_switches(void)
29863  Summary:
29864  This function stores the current switch positions to send back to the host when
29865  requested.
29866  Remarks:
29867  Refer to the switches.h interface header for function usage details.
29868  */
29869 
29870 static void
29872  {
29873  int izzqqzz=((int)(bitmapstruct.element7 |= (1 << 26))); /* 37 */
29874  uint8_t
29875  cnt1 ,
29876  temp ;
29877  temp = 0U ; /* Initialize the temporary switch position place holder.*/
29878  for
29879  (
29880  cnt1 = 0U
29881  ;
29882  ( /* 28 */
29883  cnt1 < 2U
29884  ) /* 7 */
29885  ;
29886  ( /* 7 */
29887  cnt1 ++
29888  , ((int)(bitmapstruct.element7 |= (1 << 27))) /* 27b */
29889  , ((int)(bitmapstruct.element7 |= (1 << 28)))) /* 27e */
29890  ) /* The polarity switch position takes up the lower two bit positions*/
29891  { /* of temp.*/
29892  { /* 32 */
29893  int QZZZ = ((int)(bitmapstruct.element7 |= (1 << 29))); /* 32 */
29894  temp = ( temp | SWITCH.pol_switch_S4[ cnt1 ] ) << 1 ;
29895  ((int)(bitmapstruct.element7 |= (1 << 30))); /* 6 */
29896  }
29897  }
29898  ((int)(bitmapstruct.element7 |= (1 << 31))); /* 5 */
29899  for
29900  (
29901  cnt1 = 0U
29902  ;
29903  ( /* 28 */
29904  cnt1 < 5U
29905  ) /* 7 */
29906  ;
29907  ( /* 7 */
29908  cnt1 ++
29909  , ((int)(bitmapstruct.element8 |= (1 << 0))) /* 27b */
29910  , ((int)(bitmapstruct.element8 |= (1 << 1)))) /* 27e */
29911  ) /* The knob switch positions take up the upper five bit positions*/
29912  { /* of temp. The MSB is not used.*/
29913  { /* 32 */
29914  int QZZZ = ((int)(bitmapstruct.element8 |= (1 << 2))); /* 32 */
29915  temp = ( temp | SWITCH.knob_switch_S3[ cnt1 ] ) << 1 ;
29916  ((int)(bitmapstruct.element8 |= (1 << 3))); /* 6 */
29917  }
29918  }
29919  ((int)(bitmapstruct.element8 |= (1 << 4))); /* 5 */
29920  temp = temp >> 1 ;/* Shift back one to put bits in correct position.*/
29921  SWITCH.store_buffer[ 0 ] = temp ;/* Transfer the switch positions to store buffer [0].*/
29922  temp = 0U ;/* Reset the placeholder.*/
29923  temp = ( temp | SWITCH.dump_fire_switch_S7 ) << 1 ;
29924  for
29925  (
29926  cnt1 = 0U
29927  ;
29928  ( /* 28 */
29929  cnt1 < 2U
29930  ) /* 7 */
29931  ;
29932  ( /* 7 */
29933  cnt1 ++
29934  , ((int)(bitmapstruct.element8 |= (1 << 5))) /* 27b */
29935  , ((int)(bitmapstruct.element8 |= (1 << 6)))) /* 27e */
29936  ) /* The fire switch position takes up the lower two bit positions*/
29937  { /* of temp.*/
29938  { /* 32 */
29939  int QZZZ = ((int)(bitmapstruct.element8 |= (1 << 7))); /* 32 */
29940  temp = ( temp | SWITCH.fire_switch_S1[ cnt1 ] ) << 1 ;
29941  ((int)(bitmapstruct.element8 |= (1 << 8))); /* 6 */
29942  }
29943  }
29944  ((int)(bitmapstruct.element8 |= (1 << 9))); /* 5 */
29945  for
29946  (
29947  cnt1 = 0U
29948  ;
29949  ( /* 28 */
29950  cnt1 < 3U
29951  ) /* 7 */
29952  ;
29953  ( /* 7 */
29954  cnt1 ++
29955  , ((int)(bitmapstruct.element8 |= (1 << 10))) /* 27b */
29956  , ((int)(bitmapstruct.element8 |= (1 << 11)))) /* 27e */
29957  ) /* The key switch position takes up the next three bit positions*/
29958  { /* of temp.*/
29959  { /* 32 */
29960  int QZZZ = ((int)(bitmapstruct.element8 |= (1 << 12))); /* 32 */
29961  temp = ( temp | SWITCH.key_switch_S6[ cnt1 ] ) << 1 ;
29962  ((int)(bitmapstruct.element8 |= (1 << 13))); /* 6 */
29963  }
29964  }
29965  ((int)(bitmapstruct.element8 |= (1 << 14))); /* 5 */
29966  temp = temp | SWITCH.hvps_switch_S5 ;
29967  SWITCH.store_buffer[ 1 ] = temp ;/* Transfer the switch positions to store buffer [1]. Upper two bits are not used.*/
29968  ((int)(bitmapstruct.element8 |= (1 << 15))); /* 30 */
29969  switches_57zqendz ( 272 ) ; /* 30 */
29970  }
29971 /***************************************************************************************
29972  End of File
29973  */
29974 #define qqqbranches 272
29975 #define QQQMAXMCDCSIZE 2
29976 /********************** LDRA_PORT INSTRUMENTATION **********************/
29977 
29978 /******************* END OF LDRA_PORT INSTRUMENTATION ******************/
29979 #define ldra_sscanf
29980  /* put in undefs to protect our parameter names from macros */
29981 #undef f
29982 #undef i
29983 #undef j
29984 #undef k
29985 #undef s
29986 #undef l
29987 #undef ii
29988 #undef some
29989 #undef none
29990 #undef from
29991 #undef a
29992 #undef b
29993 #undef iz
29994 #undef jz
29995 #undef qqnull_params
29996 #define qqnull_params void
29997  /* Conventional Instrumentation */
29998 #define qqzzidfield 1
29999  /* single file or fileid */
30000  /* these have an extra field for the fileid */
30001  static char qqqqone[] = "%6d\n"; /* single point */
30002  /* uncompressed data structures */
30003  /* uncompressed bitmap */
30004 #define QQQFIXEDSIZE
30005  static int qqqlast = 0;
30006  extern int qqupload_registered;
30007  extern int switches_57zqqzqz(qqnull_params);
30008  extern int switches_57zqqzqz1(qqnull_params);
30009  /* ----------------------------------------------------------------------* 200 *
30010  * Procedures
30011  * -----------------------------------------------------------------------------
30012  */
30013  /* ----------- zscanf ---------------------------------------------------* 201 *
30014  * Returns an integer extracted from a string
30015  * -----------------------------------------------------------------------------
30016  */
30017  static int switches_57zscanf(char * qqscan_str)
30018  {
30019  int qqvalue;
30020  int qqisign;
30021  char * qqcptr;
30022  qqvalue = 0;
30023  qqisign = 1;
30024  qqcptr = qqscan_str;
30025  /* Skip spaces */
30026  while (qqcptr[0] == ' ')
30027  {
30028  qqcptr++;
30029  }
30030  /* Check for a leading ---
30031  */
30032  if (qqcptr[0] == '-')
30033  {
30034  qqisign = -1;
30035  qqcptr++;
30036  }
30037  /* Extract digits */
30038  while ((qqcptr[0] >= '0') && (qqcptr[0] <= '9'))
30039  {
30040  qqvalue = 10 * qqvalue;
30041  qqvalue = qqvalue + (qqcptr[0] - '0');
30042  qqcptr++;
30043  }
30044  qqvalue = qqisign * qqvalue;
30045  return qqvalue;
30046  } /* end of zscanf */
30047  /* ----------------------------------------------------------------------* 210 *
30048  * C System utilities in use:
30049  * fprintf
30050  * fclose
30051  * sscanf
30052  * -----------------------------------------------------------------------------
30053  */
30054  /* ----------------------------------------------------------------------* 213 *
30055  * qqoutput* suite
30056  * Main output routines. These may require modification.
30057  * -----------------------------------------------------------------------------
30058  */
30059  /* ----------------------------------------------------------------------* 214 *
30060  * qqoutput
30061  * This is the principle output routine.
30062  * -----------------------------------------------------------------------------
30063  */
30064  static void qqoutput(FILEPOINT char * s,int i)
30065  /* f - file pointer, s - format string, i - integer for probe value */
30066  {
30067  /* printing to a file */
30068  /* fprintf exists, not threaded */
30069  /* fprintf exists, not threaded, ( SINGLEFILE or FILEID ) */
30070  ldra_sprintf2 (&ldra_buffer[0], s,i,zzfileid);
30071  ldra_port_write (&ldra_buffer[0]);
30072  } /* end of qqoutput */
30073  /* ----------------------------------------------------------------------* 215 *
30074  * qqoutput0
30075  * -----------------------------------------------------------------------------
30076  */
30077  static void qqoutput0(FILEPOINT char * s)
30078  {
30079  ldra_port_write(s);
30080  } /* end of qqoutput0 */
30081  /* ----------------------------------------------------------------------* 216 *
30082  * qqoutput2
30083  * -----------------------------------------------------------------------------
30084  */
30085  static void qqoutput2(FILEPOINT char * s,int i, int j)
30086  {
30087  ldra_sprintf2 (&ldra_buffer[0], s, i, j);
30088  ldra_port_write (&ldra_buffer[0]);
30089  } /* end of qqoutput2 */
30090  /* ----------------------------------------------------------------------* 217 *
30091  * qqoutput3
30092  * -----------------------------------------------------------------------------
30093  */
30094  static void qqoutput3(FILEPOINT char * s,int i,int j,int k)
30095  {
30096  ldra_sprintf3 (&ldra_buffer[0], s, i, j, k);
30097  ldra_port_write (&ldra_buffer[0]);
30098  } /* end of qqoutput3 */
30099  /* ----------------------------------------------------------------------* 218 *
30100  * qqoutput4
30101  * -----------------------------------------------------------------------------
30102  */
30103  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l)
30104  {
30105  ldra_sprintf4 (&ldra_buffer[0], s, i, j, k, l);
30106  ldra_port_write (&ldra_buffer[0]);
30107  } /* end of qqoutput4 */
30108  /* ----------------------------------------------------------------------* 219 *
30109  * end of qqoutput* suite
30110  * -----------------------------------------------------------------------------
30111  */
30112  /* ----------------------------------------------------------------------* 222 *
30113  * qqqqinitialise
30114  * This procedure initialises the structures for
30115  * compressed execution histories.
30116  * -----------------------------------------------------------------------------
30117  */
30118  static void qqqqinitialise(int ii)
30119  {
30120  unsigned int i;
30121  /* First time through. */
30122  /* bitmap */
30123  /* bitmap separate */
30124  qqqlast = 1; /* stops qqfun() calling initialise again */
30125  /* bitmap */
30126  /* bitmap singlefile */
30127  /* struct singlefile notmainfl */
30128  } /* end of qqqqinitialise */
30129 /* ----------------------------------------------------------------------* 225 *
30130 * qqqbitmapreset
30131 * This procedure resets the structures for
30132 * compressed execution histories.
30133 * -----------------------------------------------------------------------------
30134 */
30135 static void qqqbitmapreset()
30136 {
30137 struct bitmapstruct_t localbitmap = {0};
30138 bitmapstruct = localbitmap;
30139 } /* end of qqqbitmapreset */
30140 #undef QQQTEMP1
30141 #define QQQTEMP1
30142  /* ----------- zqqzqz ---------------------------------------------------* 310 *
30143  * -----------------------------------------------------------------------------
30144  */
30145  /* ----------------------------------------------------------------------* 312 *
30146  * This routine opens the execution history file. It is instrumented at the
30147  * start of the main program if one exists in the file. In general this is
30148  * superceded by switches_57zqqzqz1 below.
30149  * -----------------------------------------------------------------------------
30150  */
30152  {
30153  if ( switches_57zzopen != 1 )
30154  {
30155 #undef QQQMUSTOPEN
30156  switches_57zzopen = 1;
30157  }
30158  return(1);
30159  } /* end of zqqzqz */
30160  /* ----------- zqqzqz1 --------------------------------------------------* 315 *
30161  * -----------------------------------------------------------------------------
30162  */
30163  /* ----------------------------------------------------------------------* 317 *
30164  * This routine also opens the execution history file. It is called
30165  * automatically if a probe fires and the execution history is not already
30166  * opened (switches_57zzopen = 0 ).
30167  * Because this always works ( it was intended for files with no main program
30168  * it is now the de facto common way to open the execution history.
30169  * -----------------------------------------------------------------------------
30170  */
30172  {
30173  if ( switches_57zzopen != 1 )
30174  {
30175  ldra_port_open(); /* 7 */
30176  qqqqinitialise(0);
30177  switches_57zzopen = 1;
30178  }
30179  return(1);
30180  } /* end of zqqzqz1 */
30181  /* ----------- zqendz ---------------------------------------------------* 330 *
30182  * This routine is called on exiting a routine in a
30183  * module. It closes the execution history.
30184  * -----------------------------------------------------------------------------
30185  */
30186 static int switches_57zqendz(int qqqi)
30187  {
30188  if (!qqqstructzzopen)
30189  {
30191  qqqstructzzopen = 1;
30192  }
30193  if ( switches_57zzopen != 1 )
30194  {
30195  switches_57zqqzqz1();
30196  }
30197  /* ----------------------------------------------------------------------* 331 *
30198  * this is the one which puts an integer into
30199  * the execution history file and returns unity.
30200  * The format of each field consists of six columns,
30201  * the number is right justified in this field.
30202  * -----------------------------------------------------------------------------
30203  */
30204  if ( switches_57zzopen )
30205  {
30206  /* uncompressed */
30207  /* uncompressed unbuffered */
30208  /* uncompressed unbuffered bitmap */
30209  if ( qqqi > 0 )
30210  {
30211  }
30212  else
30213  {
30214  }
30215  }
30216  qqqlast = 0;
30217  return(1);
30218  } /* end of zqendz */
30219  /* ----------------------------------------------------------------------* 335 *
30220  * Output structure - qqbmsoutput
30221  * -----------------------------------------------------------------------------
30222  */
30223  static void qqbmsoutput(FILEPOINT char * s, unsigned int i)
30224  {
30225  static int branches_printed = 0;
30226  int b, last = 0;
30227  for(b=0;b<qqqqbmselwidth/8;b++)
30228  {
30229  ldra_sprintf1 (&ldra_buffer[0], s, (i >> last) & ~(~0 << 8));
30230  ldra_port_write (&ldra_buffer[0]);
30231  ldra_sprintf1 (&ldra_buffer[0], "%8d\n", zzfileid );
30232  ldra_port_write (&ldra_buffer[0]);
30233  last += 8;
30234  branches_printed += 8;
30235  if (branches_printed >= qqqbranches)
30236  {
30237  /* do not print any more, can be left over when using more than 8 bits to store bitmap */
30238  break;
30239  }
30240  }
30241  }
30242  /* ----------------------------------------------------------------------* 336 *
30243  * qqqupload
30244  * This routine loops through the stored bitmap and
30245  * outputs it. It then uploads the stored mcdc.
30246  * -----------------------------------------------------------------------------
30247  */
30248  static void qqqupload(qqnull_params)
30249  {
30250  int i;
30251  /* uncompressed bitmap (!singlefile or mainfl) separate */
30252  {
30253  switches_57zqqzqz1();
30254 #define ELEMENT(N) qqbmsoutput("%8d", bitmapstruct.element##N);
30255 #define LASTELEMENT
30256 #include "switches_57zbelem.def"
30257 #undef LASTELEMENT
30258 #undef ELEMENT
30259  }
30260  /* bitmap separate */
30261  qqqlast = 1; /* stops qqfun() calling initialise again */
30262  } /* end of qqqupload */
30263  /* ----------- zqzqzq ---------------------------------------------------* 342 *
30264  * -----------------------------------------------------------------------------
30265  */
30266  /* ----------------------------------------------------------------------* 344 *
30267  * This routine should be called before the program
30268  * terminates. It closes the execution history
30269  * -----------------------------------------------------------------------------
30270  */
30271  static int switches_57zqzqzq(int qqqi)
30272  {
30273  if ( switches_57zzopen != 1 )
30274  {
30275  switches_57zqqzqz1();
30276  }
30277  /* not compressed */
30278  /* do nothing for bitmap*/
30279  /* upload the history */
30280  /* bitmap */
30281  /* uncompressed bitmap */
30282  switches_57zqendz(qqqi);
30283  /* qqqupload closes the execution history file */
30284  return(1);
30285  } /* end of zqzqzq */
30286  /* the following routines should be left alone */
30287 /* END OF TESTBED INSTRUMENTATION */
30288 
bool PLIB_USART_ExistsReceiverFramingErrorStatus(USART_MODULE_ID index)
static void DRV_TMR4_Close(void)
DMA_CHANNEL PLIB_DMA_CRCChannelGet(DMA_MODULE_ID index)
S3_COMMAND
Definition: inszt_app.c:27690
bool DRV_USART0_ReceiverBufferIsEmpty(void)
void DRV_TMR2_StopInIdleEnable(void)
void DRV_TMR3_PeriodValueSet(uint32_t value)
static int switches_57zscanf(char *qqscan_str)
void APP_Initialize(void)
Definition: app.c:93
SYS_DMA_DATA_WIDTH
bool PLIB_SPI_ExistsBaudRateClock(SPI_MODULE_ID index)
void DRV_TMR2_StopInIdleDisable(void)
bool PLIB_USART_ExistsLoopback(USART_MODULE_ID index)
void PLIB_DMA_ChannelXSourceAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_SOURCE_ADDRESSING_MODE sourceAddressMode)
bool PLIB_SPI_ExistsEnableControl(SPI_MODULE_ID index)
void SYS_DMA_ChannelAbortEventSet(SYS_DMA_CHANNEL_HANDLE handle, DMA_TRIGGER_SOURCE eventSrc)
bool PLIB_SPI_ExistsBusStatus(SPI_MODULE_ID index)
SPI_BAUD_RATE_CLOCK baudClockSource
Definition: inszt_adc.c:26566
DRV_USART_BAUD_SET_RESULT DRV_USART_BaudSet(const DRV_HANDLE client, uint32_t baud)
void PLIB_DMA_ChannelXTriggerEnable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level)
void DRV_USART_AddressedBufferAddWrite(const DRV_HANDLE hClient, DRV_USART_BUFFER_HANDLE *bufferHandle, uint8_t address, void *source, size_t nWords)
void DRV_USART_TasksError(SYS_MODULE_OBJ object)
uint32_t PLIB_DMA_ChannelXSourceStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_SPI_ReceiverFIFOIsEmpty(SPI_MODULE_ID index)
void DRV_USART_ByteErrorCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
void PLIB_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void WL_SPS_Tasks(void)
void Prepare_Return_A(uint8_t byte, uint16_t data2, uint16_t data1)
void PLIB_DMA_ChannelXINTSourceDisable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void PLIB_DMA_StartTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint16_t PLIB_DMA_ChannelXCellProgressPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_DMA_ExistsCRC(DMA_MODULE_ID index)
bool PLIB_DMA_ChannelXCollisionStatus(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_COLLISION collisonType)
DRV_USART_BUFFER_EVENT
DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus(DRV_SPI_BUFFER_HANDLE bufferHandle)
bool PLIB_PORTS_ExistsPinChangeNotice(PORTS_MODULE_ID index)
COMMAND_STATES
Definition: commands.h:62
void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
bool DRV_TMR0_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
bool PLIB_PORTS_ExistsPortsOpenDrain(PORTS_MODULE_ID index)
void PLIB_DMA_CRCDisable(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
bool PLIB_SPI_ReceiverBufferIsFull(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsLatchRead(PORTS_MODULE_ID index)
uint32_t DRV_TMR2_CounterValueGet(void)
bool PLIB_USART_RunInSleepModeIsEnabled(USART_MODULE_ID index)
void PLIB_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_TMR3_CounterValueSet(uint32_t value)
static int switches_57zqzqzq(int qqqi)
DRV_TMR_OPERATION_MODE DRV_TMR3_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_USART_TransmitterBreakSend(USART_MODULE_ID index)
uint32_t PLIB_DMA_CRCXOREnableGet(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint16_t PORTS_DATA_MASK
Definition: inszt_adc.c:18519
void PLIB_USART_TransmitterIdleIsLowDisable(USART_MODULE_ID index)
SYS_MODULE_OBJ DRV_TMR_Initialize(const SYS_MODULE_INDEX drvIndex, const SYS_MODULE_INIT *const init)
void PLIB_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
S7_COMMAND
DRV_HANDLE DRV_SPI_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT ioIntent)
void DRV_IC0_Start(void)
SPI_FRAME_PULSE_POLARITY framePulsePolarity
Definition: inszt_adc.c:26551
void DRV_TMR0_Initialize(void)
bool debounce_tick
Definition: inszt_app.c:27675
size_t DRV_USART_Read(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
void DRV_TMR_AlarmDeregister(DRV_HANDLE handle)
void PLIB_SPI_BufferWrite32bit(SPI_MODULE_ID index, uint32_t data)
uint8_t DRV_USART0_ReadByte(void)
bool SYS_PORTS_PinRead(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint8_t PLIB_DMA_ChannelXPatternIgnoreGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_USART_ExistsTransmitterIdleIsLow(USART_MODULE_ID index)
float float32_t
Definition: cf.h:50
uint8_t read_try
Definition: inszt_app.c:27676
bool PLIB_DMA_ExistsLastBusAccess(DMA_MODULE_ID index)
void SYS_DEBUG_Print(const char *format,...)
static void DRV_TMR3_Open(void)
bool PLIB_SPI_IsBusy(SPI_MODULE_ID index)
static void Execute_System(void)
SYS_STATUS DRV_USART0_Status(void)
DRV_IO_BUFFER_TYPES
bool PLIB_USART_TransmitterBufferIsFull(USART_MODULE_ID index)
DRV_IO_INTENT
void PLIB_USART_TransmitterInterruptModeSelect(USART_MODULE_ID index, USART_TRANSMIT_INTR_MODE fifolevel)
void PLIB_PORTS_CnPinsEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
DMA_CRC_TYPE PLIB_DMA_CRCTypeGet(DMA_MODULE_ID index)
bool PLIB_USART_ExistsReceiver9Bits(USART_MODULE_ID index)
void DRV_USART_ByteTransmitCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
void COMMAND_Tasks(void)
Definition: commands.c:225
void PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_TMR4_Initialize(void)
DRV_SPI_PROTOCOL_TYPE
Definition: inszt_adc.c:26367
static void DRV_TMR2_Close(void)
void PLIB_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
DRV_USART_LINE_CONTROL_SET_RESULT
Definition: inszt_adc.c:15287
bool PLIB_USART_ExistsBRGClockSourceSelect(USART_MODULE_ID index)
void PLIB_DMA_ChannelXINTSourceFlagSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
Definition: hvps.h:84
bool PLIB_PORTS_ExistsChangeNoticeInIdle(PORTS_MODULE_ID index)
void HVPS_Tasks(void)
Definition: hvps.c:117
void PLIB_USART_AddressMaskSet(USART_MODULE_ID index, uint8_t mask)
uintptr_t DRV_HANDLE
uint32_t DRV_TMR1_CounterFrequencyGet(void)
bool PLIB_SPI_ExistsSlaveSelectControl(SPI_MODULE_ID index)
bool PLIB_DMA_SuspendIsEnabled(DMA_MODULE_ID index)
void PLIB_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_ADC1_Open(void)
void DRV_TMR0_CounterValueSet(uint32_t value)
WL_SPS_STATES
Definition: inszt_app.c:28425
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART0_LineControlSet(DRV_USART_LINE_CONTROL lineControlMode)
size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_SPI_ExistsStopInIdleControl(SPI_MODULE_ID index)
void SYS_PORTS_ChangeNotificationGlobalEnable(PORTS_MODULE_ID index)
SYS_DMA_TRANSFER_EVENT
void SYS_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
bool PLIB_DMA_ExistsCRCWriteByteOrder(DMA_MODULE_ID index)
bool pot_switch
Definition: hvps.h:96
void PLIB_USART_StopInIdleDisable(USART_MODULE_ID index)
bool PLIB_DMA_ExistsStopInIdle(DMA_MODULE_ID index)
SYS_DMA_CHANNEL_OP_MODE
static void store_switches(void)
DRV_USART_ERROR DRV_USART0_ErrorGet(void)
void PLIB_DMA_ChannelXStartAddressOffsetSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t address, DMA_ADDRESS_OFFSET_TYPE offset)
bool PLIB_PORTS_ExistsChangeNotice(PORTS_MODULE_ID index)
DRV_USART_LINE_CONTROL
Definition: inszt_adc.c:15315
static int qqqstructzzopen
void DRV_USART0_TasksError(void)
void DRV_ADC_Start(void)
bool PLIB_USART_ExistsReceiverOverrunStatus(USART_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR1_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
bool PLIB_PORTS_ExistsChangeNoticePullUp(PORTS_MODULE_ID index)
DRV_USART_BAUD_SET_RESULT
Definition: inszt_adc.c:15266
void PLIB_PORTS_PinDirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_DMA_ChannelSetup(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OP_MODE modeEnable, DMA_TRIGGER_SOURCE eventSrc)
bool PLIB_DMA_ExistsChannelXBusy(DMA_MODULE_ID index)
void SYS_PORTS_ChangeNotificationInIdleModeEnable(PORTS_MODULE_ID index)
#define FILEPOINT
void PLIB_DMA_ChannelXReloadDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_SPI_Disable(SPI_MODULE_ID index)
void PLIB_PORTS_PinModePerPortSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_MODE mode)
void DRV_USART_BufferAddWrite(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *bufferHandle, void *buffer, const size_t size)
void SYS_PORTS_DirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
uint16_t PLIB_DMA_ChannelXPatternDataGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
S7_COMMAND
Definition: inszt_app.c:27723
bool PLIB_SPI_ExistsCommunicationWidth(SPI_MODULE_ID index)
COMMAND_STATES
void PLIB_USART_Transmitter9BitsSend(USART_MODULE_ID index, int8_t data, bool Bit9th)
uint8_t jobQueueReserveSize
Definition: inszt_adc.c:26596
DRV_USART_LINE_CONTROL
TMR_PRESCALE DRV_TMR0_PrescalerGet(void)
PORTS_DATA_TYPE PLIB_PORTS_ReadLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_PORTS_ExistsPortsRead(PORTS_MODULE_ID index)
DRV_TMR_CLIENT_STATUS
Definition: inszt_adc.c:1801
static void qqqqinitialise(int ii)
bool DRV_TMR_AlarmRegister(DRV_HANDLE handle, uint32_t divider, bool isPeriodic, uintptr_t context, DRV_TMR_CALLBACK callBack)
SYS_MODULE_INIT moduleInit
Definition: inszt_adc.c:26535
bool PLIB_USART_TransmitterBreakSendIsComplete(USART_MODULE_ID index)
void PLIB_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_TMR3_CounterClear(void)
bool PLIB_DMA_IsBusy(DMA_MODULE_ID index)
S7_COMMAND S7_state
Definition: inszt_app.c:27776
bool PLIB_USART_ReceiverParityErrorHasOccurred(USART_MODULE_ID index)
void SYS_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
DRV_TMR_OPERATION_MODE DRV_TMR0_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
uint32_t PLIB_USART_BaudRateGet(USART_MODULE_ID index, int32_t clockFrequency)
void PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_SPI_FrameSyncPulseCounterSelect(SPI_MODULE_ID index, SPI_FRAME_SYNC_PULSE pulse)
uint32_t DRV_IC0_Capture32BitDataRead(void)
uint32_t DRV_TMR_CounterValueGet(DRV_HANDLE handle)
bool PLIB_USART_ExistsReceiverDataAvailableStatus(USART_MODULE_ID index)
void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
void DRV_TMR1_Stop(void)
uint32_t DRV_TMR3_CounterValueGet(void)
void PLIB_DMA_ChannelXDestinationStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t destinationStartAddress)
static int qqqisinitialised
Definition: inszt_main.c:152
void PLIB_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION inputFunction, PORTS_REMAP_INPUT_PIN remapInputPin)
void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index, SPI_AUDIO_PROTOCOL mode)
bool PLIB_DMA_ExistsCRCXOREnable(DMA_MODULE_ID index)
bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
DRV_SPI_TASK_MODE
Definition: inszt_adc.c:26444
uint16_t store_buffer[2]
Definition: inszt_app.c:27671
void PLIB_DMA_ChannelXTransferCountSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t transferCount)
bool DRV_IC0_BufferIsEmpty(void)
bool PLIB_DMA_ExistsChannelXCellProgressPointer(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXChainToHigher(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXBusyInActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXAbortIRQ(DMA_MODULE_ID index)
bool DRV_TMR_Start(DRV_HANDLE handle)
bool PLIB_USART_ExistsTransmitter(USART_MODULE_ID index)
#define qqnull_params
bool DRV_TMR1_Start(void)
DRV_TMR_OPERATION_MODE DRV_TMR2_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void DRV_TMR1_StopInIdleDisable(void)
void DRV_TMR0_Stop(void)
void PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static int switches_57zqendz(int qqqi)
bool PLIB_DMA_ExistsChannelXDestinationPointer(DMA_MODULE_ID index)
bool PLIB_DMA_ChannelXNullWriteModeIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_TransmitterDisable(USART_MODULE_ID index)
bool PLIB_DMA_ExistsSuspend(DMA_MODULE_ID index)
static void DRV_TMR1_Open(void)
void PLIB_DMA_CRCAppendModeDisable(DMA_MODULE_ID index)
uint32_t DRV_TMR3_PeriodValueGet(void)
INT_SOURCE txInterruptSource
Definition: inszt_adc.c:26580
void PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod)
DRV_SPI_BUFFER_TYPE
Definition: inszt_adc.c:26344
static void DRV_TMR0_DeInitialize(void)
void DRV_PMP0_Initialize(void)
bool PLIB_DMA_ExistsChannelXINTSource(DMA_MODULE_ID index)
bool PLIB_USART_ExistsWakeOnStart(USART_MODULE_ID index)
void DRV_USART_Deinitialize(SYS_MODULE_OBJ object)
void SYS_DEBUG_Message(const char *message)
bool PLIB_DMA_ChannelXEventIsDetected(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint32_t PLIB_SPI_BufferRead32bit(SPI_MODULE_ID index)
void PLIB_USART_BaudRateHighDisable(USART_MODULE_ID index)
bool DRV_TMR_AlarmDisable(DRV_HANDLE handle)
void PLIB_SPI_FrameSyncPulseEdgeSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_EDGE edge)
bool PLIB_USART_ReceiverOverrunHasOccurred(USART_MODULE_ID index)
void PLIB_DMA_ChannelXSourceSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t sourceSize)
void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index, int8_t Mask)
void PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
DRV_SPI_BUFFER_EVENT
Definition: inszt_adc.c:26399
void DRV_TMR3_StopInIdleDisable(void)
void SYS_DMA_Suspend(void)
void PLIB_SPI_Enable(SPI_MODULE_ID index)
void DRV_ADC_Initialize(void)
void DRV_IC_Stop(DRV_HANDLE handle)
DRV_USART_TRANSFER_STATUS
Definition: inszt_adc.c:15489
DRV_TMR_OPERATION_MODE
Definition: inszt_adc.c:1848
DRV_USART_BAUD_SET_RESULT
bool PLIB_USART_ExistsOperationMode(USART_MODULE_ID index)
void PLIB_SPI_StopInIdleDisable(SPI_MODULE_ID index)
S5_COMMAND S5_state
Definition: inszt_app.c:27778
void PLIB_USART_ReceiverAddressAutoDetectDisable(USART_MODULE_ID index)
SYS_DMA_CHANNEL_IGNORE_MATCH
Definition: inszt_adc.c:13316
SPI_FRAME_PULSE_DIRECTION framePulseDirection
Definition: inszt_adc.c:26553
void PLIB_SPI_OutputDataPhaseSelect(SPI_MODULE_ID index, SPI_OUTPUT_DATA_PHASE phase)
bool DRV_SPIn_ReceiverBufferIsFull(void)
bool PLIB_USART_ExistsRunInSleepMode(USART_MODULE_ID index)
DRV_TMR_CLIENT_STATUS DRV_TMR2_ClientStatus(void)
USART_ERROR PLIB_USART_ErrorsGet(USART_MODULE_ID index)
bool PLIB_SPI_ExistsReceiveFIFOStatus(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsPinChangeNoticePerPort(PORTS_MODULE_ID index)
HVPS_STATES
static void qqqupload(qqnull_params)
SYS_DMA_ERROR
Definition: inszt_adc.c:13491
bool PLIB_DMA_ExistsCRCPolynomialLength(DMA_MODULE_ID index)
uint8_t PLIB_USART_AddressMaskGet(USART_MODULE_ID index)
void PLIB_SPI_BufferClear(SPI_MODULE_ID index)
uint32_t dummyByteValue
Definition: inszt_adc.c:26589
bool PLIB_SPI_ExistsFIFOCount(SPI_MODULE_ID index)
static int zzfileid
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsReceiverOverflow(SPI_MODULE_ID index)
SYS_DMA_SIDL
Definition: inszt_adc.c:13275
void DRV_USART_Close(const DRV_HANDLE handle)
void PLIB_DMA_Enable(DMA_MODULE_ID index)
#define switches_57zzopen
void PLIB_DMA_AbortTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void DRV_TMR0_Open(void)
int QQQfcn_ptr_num
Definition: inszt_main.c:151
static int tbrun_mode
void PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
SYS_DMA_CHANNEL_CRC_MODE
Definition: inszt_adc.c:13335
SYS_MODULE_OBJ SYS_DEBUG_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
void PLIB_USART_ReceiverEnable(USART_MODULE_ID index)
void PLIB_SPI_PinDisable(SPI_MODULE_ID index, SPI_PIN pin)
uintptr_t DRV_HANDLE
Definition: inszt_adc.c:1108
bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_SPI_PROTOCOL_TYPE spiProtocolType
Definition: inszt_adc.c:26545
uint8_t PLIB_SPI_BufferRead(SPI_MODULE_ID index)
bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
SPI_FRAME_PULSE_WIDTH framePulseWidth
Definition: inszt_adc.c:26557
bool PLIB_USART_ExistsReceiverAddress(USART_MODULE_ID index)
S1_COMMAND
static DRV_TMR_OPERATION_MODE DRV_TMR4_OperationModeGet(void)
static unsigned char qqqzzglobflag
void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_DMA_ChannelXIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
uint32_t DRV_TMR1_CounterValueGet(void)
bool PLIB_PORTS_ExistsAnPinsMode(PORTS_MODULE_ID index)
bool PLIB_USART_ExistsReceiverInterruptMode(USART_MODULE_ID index)
static void DRV_TMR2_Open(void)
uint32_t baudRate
Definition: inszt_adc.c:26572
uint32_t DRV_TMR2_CounterFrequencyGet(void)
bool PLIB_DMA_ChannelXAutoIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool DRV_TMR1_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
void PLIB_USART_BaudSetAndEnable(USART_MODULE_ID index, uint32_t systemClock, uint32_t baud)
void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_USART_ExistsTransmitterInterruptMode(USART_MODULE_ID index)
void PLIB_DMA_ChannelXDataSizeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_DATA_SIZE channelDataSize)
bool PLIB_SPI_ExistsInputSamplePhase(SPI_MODULE_ID index)
SYS_ERROR_LEVEL
DRV_USART_ERROR
void SYS_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION function, PORTS_REMAP_INPUT_PIN remapPin)
void PLIB_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
bool PLIB_USART_ExistsEnable(USART_MODULE_ID index)
bool PLIB_USART_RunInOverflowIsEnabled(USART_MODULE_ID index)
void PLIB_PORTS_CnPinsDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
DRV_USART_BAUD_SET_RESULT DRV_USART0_BaudSet(uint32_t baud)
bool PLIB_DMA_ExistsChannelXEvent(DMA_MODULE_ID index)
static void DRV_TMR1_DeInitialize(void)
unsigned int DRV_USART0_TransmitBufferSizeGet(void)
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
static DRV_TMR_OPERATION_MODE DRV_TMR0_OperationModeGet(void)
bool DRV_TMR3_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
int qqupload_registered
Definition: inszt_main.c:6760
#define qqqbranches
void PLIB_SPI_StopInIdleEnable(SPI_MODULE_ID index)
unsigned char uchar8_t
Definition: commands.h:52
bool PLIB_DMA_ExistsAbortTransfer(DMA_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXDestinationPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
int16_t PLIB_USART_Receiver9BitsReceive(USART_MODULE_ID index)
bool PLIB_USART_TransmitterIsEmpty(USART_MODULE_ID index)
bool PLIB_SPI_ExistsTransmitBufferFullStatus(SPI_MODULE_ID index)
void PLIB_DMA_CRCXOREnableSet(DMA_MODULE_ID index, uint32_t DMACRCXOREnableMask)
SYS_PORTS_PIN_DIRECTION
Definition: inszt_adc.c:21888
void PLIB_USART_RunInOverflowDisable(USART_MODULE_ID index)
DRV_SPI_BUFFER_EVENT
bool PLIB_DMA_ChannelXTriggerIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
uint32_t DRV_TMR1_PeriodValueGet(void)
bool PLIB_PORTS_PinGetLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
static SYS_STATUS DRV_TMR0_Status(void)
void(* ldra_void_function)()
void DRV_PMP0_Write(uint8_t data)
DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXSourcePointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
size_t DRV_USART_BufferProcessedSizeGet(DRV_USART_BUFFER_HANDLE bufferHandle)
DRV_USART_BUFFER_RESULT
bool PLIB_DMA_CRCIsEnabled(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsPinMode(PORTS_MODULE_ID index)
void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
bool debounce_flag
Definition: inszt_app.c:27674
void SYS_DMA_ChannelSetupMatchAbortMode(SYS_DMA_CHANNEL_HANDLE handle, uint16_t pattern, DMA_PATTERN_LENGTH length, SYS_DMA_CHANNEL_IGNORE_MATCH ignore, uint8_t ignorePattern)
void PLIB_DMA_ChannelXNullWriteModeDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_TMR_CLK_SOURCES
uint32_t DRV_TMR0_PeriodValueGet(void)
void SYS_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
bool DRV_USART0_TransmitBufferIsFull(void)
void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
S4_COMMAND
void PLIB_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
void PLIB_DMA_ChannelXPatternIgnoreSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint8_t pattern)
void qqqtotalreset(void)
Definition: inszt_main.c:7067
void SYS_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION function, PORTS_REMAP_OUTPUT_PIN remapPin)
bool PLIB_USART_ExistsTransmitterBufferFullStatus(USART_MODULE_ID index)
void SYS_DEBUG_Reinitialize(SYS_MODULE_OBJ object, const SYS_MODULE_INIT *const init)
PORTS_DATA_MASK SYS_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_PORTS_DirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void DRV_TMR2_CounterClear(void)
void SYS_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_USART_TasksTransmit(SYS_MODULE_OBJ object)
bool PLIB_USART_ExistsLineControlMode(USART_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXAuto(DMA_MODULE_ID index)
void PLIB_SPI_FIFOInterruptModeSelect(SPI_MODULE_ID index, SPI_FIFO_INTERRUPT mode)
uint32_t DRV_TMR4_PeriodValueGet(void)
uint8_t DRV_USART_ReadByte(const DRV_HANDLE handle)
bool PLIB_SPI_ExistsFIFOInterruptMode(SPI_MODULE_ID index)
DRV_USART_HANDSHAKE
Definition: inszt_adc.c:15241
DRV_SPI_MODE
Definition: inszt_adc.c:26421
void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void SYS_PORTS_PinPullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_USART_WriteByte(const DRV_HANDLE handle, const uint8_t byte)
DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus(DRV_HANDLE handle)
DRV_SPI_BUFFER_TYPE bufferType
Definition: inszt_adc.c:26574
void PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXSourceSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_DMA_ChannelXNullWriteModeEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t PLIB_DMA_CRCDataRead(DMA_MODULE_ID index)
void PLIB_SPI_BufferWrite16bit(SPI_MODULE_ID index, uint16_t data)
SYS_MODULE_OBJ DRV_USART0_Initialize(void)
SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT *const init)
bool PLIB_USART_ExistsRunInOverflow(USART_MODULE_ID index)
void PLIB_PORTS_CnPinsPullUpDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
uint32_t DRV_TMR0_CounterFrequencyGet(void)
bool PLIB_DMA_ExistsChannelXSourceStartAddress(DMA_MODULE_ID index)
DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_IsEnabled(DMA_MODULE_ID index)
void SYS_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_SPI_FramedCommunicationDisable(SPI_MODULE_ID index)
bool DRV_TMR4_Start(void)
bool PLIB_PORTS_ExistsChangeNoticePullDownPerPort(PORTS_MODULE_ID index)
DRV_USART_CLIENT_STATUS
Definition: inszt_adc.c:15464
void PLIB_DMA_BusyActiveReset(DMA_MODULE_ID index)
uint32_t SYS_DMA_ChannelCRCGet(void)
void PLIB_SPI_FrameSyncPulsePolaritySelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_POLARITY polarity)
bool PLIB_USART_ExistsTransmitter9BitsSend(USART_MODULE_ID index)
void PLIB_DMA_ChannelXAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_ADDRESSING_MODE channelAddressMode)
static void DRV_TMR4_Open(void)
bool DRV_USART_TransmitBufferIsFull(const DRV_HANDLE handle)
void PLIB_SPI_FrameSyncPulseWidthSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_WIDTH width)
uint16_t DRV_IC0_Capture16BitDataRead(void)
void PLIB_DMA_CRCEnable(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXSourceStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t sourceStartAddress)
bool PLIB_DMA_ChannelXChainIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_LoopbackDisable(USART_MODULE_ID index)
void PLIB_DMA_ChannelXDisabledEnablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsTransmitterEmptyStatus(USART_MODULE_ID index)
void PLIB_USART_InitializeOperation(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE receiveInterruptMode, USART_TRANSMIT_INTR_MODE transmitInterruptMode, USART_OPERATION_MODE operationMode)
bool PLIB_SPI_ExistsFrameSyncPulseEdge(SPI_MODULE_ID index)
void DRV_TMR_Deinitialize(SYS_MODULE_OBJ object)
void SYS_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_PORTS_ExistsPortsDirection(PORTS_MODULE_ID index)
DRV_IO_INTENT
Definition: inszt_adc.c:975
SYS_DMA_CHANNEL_IGNORE_MATCH
bool PLIB_PORTS_ExistsSlewRateControl(PORTS_MODULE_ID index)
static void DRV_TMR2_Tasks(void)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26603
void DRV_ADC0_Open(void)
unsigned int DRV_USART0_ReceiverBufferSizeGet(void)
void PLIB_SPI_AudioProtocolEnable(SPI_MODULE_ID index)
static void qqoutput3(FILEPOINT char *s, int i, int j, int k)
static void execute_switches(void)
DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_SPI_MODE
TMR_PRESCALE DRV_TMR4_PrescalerGet(void)
DRV_USART_TRANSFER_STATUS DRV_USART0_TransferStatus(void)
void PLIB_DMA_CRCWriteByteOrderMaintain(DMA_MODULE_ID index)
bool PLIB_DMA_ChannelXBufferedDataIsWritten(DMA_MODULE_ID index, DMA_CHANNEL channel)
PORTS_PIN_INTERRUPT_TYPE
TMR_PRESCALE DRV_TMR2_PrescalerGet(void)
bool PLIB_USART_ExistsStopInIdle(USART_MODULE_ID index)
bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_HANDLE DRV_USART0_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
void PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void DRV_TMR2_Initialize(void)
uint8_t PLIB_USART_AddressGet(USART_MODULE_ID index)
void SYS_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
void PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
bool DRV_TMR2_Start(void)
bool PLIB_DMA_ExistsChannelXSourcePointer(DMA_MODULE_ID index)
int32_t DRV_SPI_ClientConfigure(DRV_HANDLE handle, const DRV_SPI_CLIENT_DATA *cfgData)
WL_SPS_DATA WL_SPS
Definition: wl_sps.c:59
void PLIB_SPI_FramedCommunicationEnable(SPI_MODULE_ID index)
uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
void qqqtotalupload(void)
Definition: inszt_main.c:7054
DRV_USART_CLIENT_STATUS
void PLIB_USART_RunInSleepModeDisable(USART_MODULE_ID index)
static void Execute_Protocol_A(void)
bool PLIB_SPI_ExistsAudioProtocolControl(SPI_MODULE_ID index)
SYS_DMA_CHANNEL_OP_MODE
Definition: inszt_adc.c:13381
void DRV_SPI_Close(DRV_HANDLE handle)
bool PLIB_PORTS_ExistsRemapOutput(PORTS_MODULE_ID index)
PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_PORTS_ChangeNoticeEnable(PORTS_MODULE_ID index)
SPI_FRAME_PULSE_EDGE framePulseEdge
Definition: inszt_adc.c:26555
void SYS_PORTS_PinDirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index, USART_LINECONTROL_MODE dataFlowConfig)
void PLIB_SPI_AudioTransmitModeSelect(SPI_MODULE_ID index, SPI_AUDIO_TRANSMIT_MODE mode)
bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
void DRV_TMR_CounterClear(DRV_HANDLE handle)
void DRV_TMR_Stop(DRV_HANDLE handle)
void PLIB_DMA_SuspendDisable(DMA_MODULE_ID index)
void SYS_PORTS_ChangeNotificationGlobalDisable(PORTS_MODULE_ID index)
static void Execute_Auto_Protocol_A(void)
SPI_MODULE_ID spiId
Definition: inszt_adc.c:26537
static void DRV_TMR0_Tasks(void)
bool PLIB_SPI_ExistsReceiveBufferStatus(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXDestinationSize(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXINTSourceFlagClear(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void DRV_TMR1_CounterValueSet(uint32_t value)
void PLIB_DMA_BusyActiveSet(DMA_MODULE_ID index)
SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate(DMA_CHANNEL channel)
void DRV_TMR_AlarmEnable(DRV_HANDLE handle, bool enable)
bool PLIB_DMA_ExistsChannelXDisabled(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsRecentAddress(DMA_MODULE_ID index)
void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
void DRV_USART0_TasksTransmit(void)
TMR_PRESCALE DRV_TMR_PrescalerGet(DRV_HANDLE handle)
void PLIB_DMA_ChannelXChainDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
PORTS_DATA_MASK PLIB_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void DRV_TMR2_CounterValueSet(uint32_t value)
bool DRV_TMR_ClockSet(DRV_HANDLE handle, DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE preScale)
void SYS_PORTS_PinPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_USART_InitializeModeGeneral(USART_MODULE_ID index, bool autobaud, bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle)
SYS_DMA_CHANNEL_CRC_MODE
void PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_MODULE_ID index)
void PLIB_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_USART_ReceiverDataIsAvailable(USART_MODULE_ID index)
PORTS_DATA_TYPE SYS_PORTS_LatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
SYS_ERROR_LEVEL
Definition: inszt_adc.c:17548
void PLIB_DMA_CRCTypeSet(DMA_MODULE_ID index, DMA_CRC_TYPE CRCType)
static int qqqqbmselwidth
SYS_PORTS_PIN_DIRECTION
S3_COMMAND S3_state
Definition: inszt_app.c:27774
uintptr_t DRV_USART_BUFFER_HANDLE
Definition: inszt_adc.c:15035
bool DRV_USART_ReceiverBufferIsEmpty(const DRV_HANDLE handle)
uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_ADDRESS_OFFSET_TYPE offset)
struct _DRV_SPI_INIT DRV_SPI_INIT
DRV_TMR_CLIENT_STATUS DRV_TMR1_ClientStatus(void)
bool PLIB_DMA_ExistsChannelXDestinationStartAddress(DMA_MODULE_ID index)
void PLIB_PORTS_DirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
bool PLIB_SPI_ExistsFIFOControl(SPI_MODULE_ID index)
ldra_void_function qqqaccumupload[QQQnumfil]
Definition: inszt_main.c:153
void DRV_TMR4_StopInIdleDisable(void)
static void read_switches(void)
void DRV_USART0_TasksReceive(void)
void DRV_TMR4_Stop(void)
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26610
static void DRV_TMR3_Close(void)
size_t DRV_USART_Write(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART_LineControlSet(const DRV_HANDLE client, const DRV_USART_LINE_CONTROL lineControl)
bool PLIB_PORTS_ExistsChangeNoticePullUpPerPort(PORTS_MODULE_ID index)
void PLIB_DMA_ChannelXCellSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t CellSize)
void DRV_TMR3_Stop(void)
static void qqoutput4(FILEPOINT char *s, int i, int j, int k, int l)
CLK_BUSES_PERIPHERAL spiClk
Definition: inszt_adc.c:26570
TMR_PRESCALE DRV_TMR3_PrescalerGet(void)
DRV_USART_LINE_CONTROL_SET_RESULT
uint8_t key_switch_S6[3]
Definition: inszt_app.c:27662
void PLIB_PORTS_ChangeNoticeDisable(PORTS_MODULE_ID index)
bool DRV_ADC_SamplesAvailable(uint8_t bufIndex)
static void DRV_TMR0_Close(void)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
void SYS_PORTS_ChangeNotificationPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void SYS_DMA_ChannelTransferAdd(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
size_t DRV_USART_BufferCompletedBytesGet(DRV_USART_BUFFER_HANDLE bufferHandle)
void PLIB_USART_Disable(USART_MODULE_ID index)
void DRV_TMR_AlarmPeriodSet(DRV_HANDLE handle, uint32_t value)
void(* DRV_USART_BYTE_EVENT_HANDLER)(const SYS_MODULE_INDEX index)
DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_AddressSet(USART_MODULE_ID index, uint8_t address)
void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
bool DRV_TMR_GateModeClear(DRV_HANDLE handle)
void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
bool PLIB_USART_ExistsReceiverAddressMask(USART_MODULE_ID index)
void PLIB_SPI_FIFODisable(SPI_MODULE_ID index)
SPI_COMMUNICATION_WIDTH commWidth
Definition: inszt_adc.c:26563
void PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
DRV_SPI_CLOCK_MODE
bool PLIB_USART_ExistsTransmitterEnable(USART_MODULE_ID index)
static char qqqqone[]
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
bool DRV_TMR3_Start(void)
unsigned char uchar8_t
bool PLIB_SPI_ExistsAudioProtocolMode(SPI_MODULE_ID index)
void SYS_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove(DRV_USART_BUFFER_HANDLE bufferHandle)
void PLIB_DMA_ChannelXDisabledDisablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsBuffer(SPI_MODULE_ID index)
void(* DRV_USART_BUFFER_EVENT_HANDLER)(DRV_USART_BUFFER_EVENT event, DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t context)
void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index, SPI_CLOCK_POLARITY polarity)
void PLIB_DMA_CRCAppendModeEnable(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsChannelChangeNoticeMethod(PORTS_MODULE_ID index)
bool PLIB_DMA_ChannelXBusyIsBusy(DMA_MODULE_ID index, DMA_CHANNEL channel)
unsigned int DRV_USART_TransmitBufferSizeGet(const DRV_HANDLE handle)
WL_SPS_STATES
DRV_ADC_MODULE_ID
uintptr_t DRV_SPI_BUFFER_HANDLE
COMMAND_DATA CMD
Definition: commands.c:196
uint32_t DRV_TMR_AlarmPeriodGet(DRV_HANDLE handle)
uint32_t DRV_TMR_CounterFrequencyGet(DRV_HANDLE handle)
void PLIB_PORTS_AnPinsModeSelect(PORTS_MODULE_ID index, PORTS_AN_PIN anPins, PORTS_PIN_MODE mode)
bool PLIB_DMA_ExistsCRCChannel(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsRemapInput(PORTS_MODULE_ID index)
uint32_t PORTS_DATA_TYPE
Definition: inszt_adc.c:18532
SWITCH_STATES state
Definition: inszt_app.c:27660
DRV_USART_OPERATION_MODE
Definition: inszt_adc.c:15059
S1_COMMAND
Definition: inszt_app.c:27739
void DRV_SPI_Deinitialize(SYS_MODULE_OBJ object)
DRV_USART_ERROR
Definition: inszt_adc.c:15426
HVPS_STATES
Definition: hvps.h:54
void * PLIB_USART_ReceiverAddressGet(USART_MODULE_ID index)
void SYS_PORTS_ChangeNotificationInIdleModeDisable(PORTS_MODULE_ID index)
uint8_t queueSize
Definition: inszt_adc.c:26592
static DRV_TMR_OPERATION_MODE DRV_TMR3_OperationModeGet(void)
void PLIB_DMA_ChannelPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL_PRIORITY channelPriority)
#define DRV_IC_Open(drvIndex, intent)
bool SYS_DMA_IsBusy(void)
int qqqshell_upload
Definition: inszt_main.c:150
static int switches_57zqqzqz(qqnull_params)
void PLIB_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION outputFunction, PORTS_REMAP_OUTPUT_PIN remapOutputPin)
DRV_TMR_OPERATION_MODE DRV_TMR4_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
static SYS_STATUS DRV_TMR1_Status(void)
DRV_SPI_TASK_MODE
SYS_PORTS_PULLUP_PULLDOWN_STATUS
Definition: inszt_adc.c:21864
void DRV_TMR0_CounterClear(void)
#define QQQnumfil
void PLIB_DMA_CRCDataWrite(DMA_MODULE_ID index, uint32_t DMACRCdata)
bool PLIB_USART_ExistsBaudRateHigh(USART_MODULE_ID index)
size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
unsigned int DRV_USART_ReceiverBufferSizeGet(const DRV_HANDLE handle)
void DRV_USART0_Deinitialize(void)
void PLIB_SPI_FIFOEnable(SPI_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
SYS_MODULE_OBJ DRV_USART_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
bool PLIB_SPI_TransmitBufferIsEmpty(SPI_MODULE_ID index)
bool PLIB_USART_ExistsTransmitterBreak(USART_MODULE_ID index)
#define DRV_IC_Close(handle)
bool PLIB_DMA_ExistsChannelXPatternIgnore(DMA_MODULE_ID index)
bool PLIB_USART_ExistsHandshakeMode(USART_MODULE_ID index)
DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void DRV_TMR2_DeInitialize(void)
uint8_t pol_switch_S4[2]
Definition: inszt_app.c:27663
static void DRV_TMR3_Tasks(void)
bool DepthStatus
Definition: commands.c:204
uint8_t dump_fire_switch_S7
Definition: inszt_app.c:27664
uint16_t voltage
Definition: inszt_app.c:28452
void PLIB_USART_Enable(USART_MODULE_ID index)
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26642
static DRV_TMR_OPERATION_MODE DRV_TMR1_OperationModeGet(void)
bool PLIB_PORTS_ExistsPortsWrite(PORTS_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXTransferCountGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_SuspendEnable(DMA_MODULE_ID index)
void SYS_PORTS_PinPullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint16_t PORTS_DATA_MASK
void SYS_PORTS_InterruptEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_INTERRUPT_TYPE pinInterruptType)
bool PLIB_DMA_ChannelXINTSourceFlagGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void SYS_DEBUG_Deinitialize(SYS_MODULE_OBJ object)
void DRV_IC0_Stop(void)
int QQQindicator
Definition: inszt_main.c:104
bool spiSlaveSSPin
Definition: inszt_adc.c:26547
bool PLIB_DMA_ExistsChannelXCellSize(DMA_MODULE_ID index)
void SYS_PORTS_ChangeNotificationEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum, SYS_PORTS_PULLUP_PULLDOWN_STATUS value)
void DRV_USART_ByteReceiveCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
DRV_SPI_PROTOCOL_TYPE
DRV_USART_HANDSHAKE
uint16_t PLIB_SPI_BufferRead16bit(SPI_MODULE_ID index)
void APP_Tasks(void)
Definition: app.c:130
bool PLIB_SPI_Exists16bitBuffer(SPI_MODULE_ID index)
void PLIB_DMA_StopInIdleDisable(DMA_MODULE_ID index)
bool PLIB_USART_BaudRateAutoDetectIsComplete(USART_MODULE_ID index)
void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
SYS_DMA_ERROR
void PLIB_DMA_ChannelXTransferDirectionSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection)
void DRV_TMR4_CounterClear(void)
void PLIB_DMA_ChannelXPatternDataSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t patternData)
void(* SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER)(SYS_DMA_TRANSFER_EVENT event, SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
void PLIB_SPI_CommunicationWidthSelect(SPI_MODULE_ID index, SPI_COMMUNICATION_WIDTH width)
void DRV_TMR2_Stop(void)
DRV_USART_BUFFER_EVENT
Definition: inszt_adc.c:15096
void PLIB_DMA_ChannelXEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_SPI_CLOCK_MODE
Definition: inszt_adc.c:26299
SYS_DMA_SIDL
bool DRV_TMR_GateModeSet(DRV_HANDLE handle)
void PLIB_SPI_PinEnable(SPI_MODULE_ID index, SPI_PIN pin)
void PLIB_USART_BaudRateAutoDetectEnable(USART_MODULE_ID index)
DRV_CLIENT_STATUS
void PLIB_USART_WakeOnStartDisable(USART_MODULE_ID index)
DRV_USART_ERROR DRV_USART_ErrorGet(const DRV_HANDLE client)
bool GetDepthStatus(void)
bool PLIB_DMA_ExistsCRCType(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXBusyActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t DRV_TMR2_PeriodValueGet(void)
bool PLIB_DMA_ExistsChannelBits(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXINTSourceFlag(DMA_MODULE_ID index)
bool PLIB_SPI_TransmitBufferIsFull(SPI_MODULE_ID index)
uint8_t PLIB_SPI_FIFOCountGet(SPI_MODULE_ID index, SPI_FIFO_TYPE type)
uint16_t PLIB_DMA_ChannelXDestinationSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_DMA_ChannelXAutoDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t DRV_TMR4_CounterFrequencyGet(void)
void Set_HVPS_Ramp_Rate(uint16_t value)
Definition: hvps.c:89
void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
bool PLIB_DMA_ExistsChannelX(DMA_MODULE_ID index)
DRV_USART_INIT_FLAGS
Definition: inszt_adc.c:15364
bool PLIB_USART_ReceiverFramingErrorHasOccurred(USART_MODULE_ID index)
bool PLIB_SPI_ExistsTransmitUnderRunStatus(SPI_MODULE_ID index)
SYS_DMA_CRC_WRITE_ORDER
Definition: inszt_adc.c:13358
SYS_DMA_CHANNEL_CHAIN_PRIO
void SYS_PORTS_ChangeNotificationDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void DRV_TMR0_PeriodValueSet(uint32_t value)
bool PLIB_DMA_ExistsChannelXChain(DMA_MODULE_ID index)
void SYS_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
SYS_PORTS_PULLUP_PULLDOWN_STATUS
void DRV_TMR1_PeriodValueSet(uint32_t value)
bool PLIB_SPI_ExistsFramedCommunication(SPI_MODULE_ID index)
bool PLIB_USART_ExistsIrDA(USART_MODULE_ID index)
bool PLIB_SPI_ExistsFrameSyncPulsePolarity(SPI_MODULE_ID index)
void SYS_DMA_ChannelTransferSet(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
static DRV_TMR_OPERATION_MODE DRV_TMR2_OperationModeGet(void)
void PLIB_USART_ReceiverIdleStateLowEnable(USART_MODULE_ID index)
bool PLIB_USART_ExistsReceiverIdleStateLowEnable(USART_MODULE_ID index)
void PLIB_USART_TransmitterEnable(USART_MODULE_ID index)
void PLIB_PORTS_ChannelSlewRateSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK channelMask, PORTS_PIN_SLEW_RATE slewRate)
static int QQQfirstmcdc
bool PLIB_SPI_ExistsErrorInterruptControl(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticeEdgeControl(PORTS_MODULE_ID index)
static void DRV_TMR1_Tasks(void)
bool PLIB_DMA_ChannelXReloadIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsReceiverAddressAutoDetect(USART_MODULE_ID index)
void DRV_PMP0_ModeConfig(void)
SYS_STATUS DRV_SPI_Status(SYS_MODULE_OBJ object)
bool PLIB_SPI_ExistsAudioCommunicationWidth(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXTrigger(DMA_MODULE_ID index)
bool DRV_TMR2_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
bool PLIB_SPI_ExistsMasterControl(SPI_MODULE_ID index)
SPI_INPUT_SAMPLING_PHASE inputSamplePhase
Definition: inszt_adc.c:26578
bool SYS_PORTS_PinLatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_SPI_ExistsAudioErrorControl(SPI_MODULE_ID index)
DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus(const DRV_HANDLE handle)
void SYS_PORTS_PinPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26635
void Set_WL_SPS_CurrentLimit(uint16_t value)
uint8_t knob_switch_S3[5]
Definition: inszt_app.c:27661
bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
void PLIB_DMA_StopInIdleEnable(DMA_MODULE_ID index)
void DRV_TMR_Tasks(SYS_MODULE_OBJ object)
DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXPeripheralAddressSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t peripheraladdress)
DRV_TMR_CLIENT_STATUS DRV_TMR0_ClientStatus(void)
void SYS_DMA_ChannelTransferEventHandlerSet(SYS_DMA_CHANNEL_HANDLE handle, const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler, const uintptr_t contextHandle)
uint8_t PLIB_DMA_CRCPolynomialLengthGet(DMA_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
bool PLIB_SPI_ExistsAudioTransmitMode(SPI_MODULE_ID index)
void SYS_DMA_ChannelCRCSet(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc)
void PLIB_SPI_AudioCommunicationWidthSelect(SPI_MODULE_ID index, SPI_AUDIO_COMMUNICATION_WIDTH mode)
void PLIB_USART_TransmitterByteSend(USART_MODULE_ID index, int8_t data)
bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_CHANGE_NOTICE_EDGE cnEdgeType)
void PLIB_USART_IrDADisable(USART_MODULE_ID index)
DRV_TMR_CLIENT_STATUS DRV_TMR4_ClientStatus(void)
SWITCH_STATES
bool PLIB_DMA_ExistsChannelXPatternIgnoreByte(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePerPortInIdle(PORTS_MODULE_ID index)
void DRV_USART0_Close(void)
bool PLIB_SPI_ReceiverHasOverflowed(SPI_MODULE_ID index)
void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index, USART_HANDSHAKE_MODE handshakeConfig)
DMA_CHANNEL_INT_SOURCE PLIB_DMA_ChannelXTriggerSourceNumberGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_IrDAEnable(USART_MODULE_ID index)
void PLIB_DMA_CRCByteOrderSelect(DMA_MODULE_ID index, DMA_CRC_BYTE_ORDER byteOrder)
void PLIB_USART_TransmitterIdleIsLowEnable(USART_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_PMP0_TimingSet(PMP_DATA_WAIT_STATES dataWait, PMP_STROBE_WAIT_STATES strobeWait, PMP_DATA_HOLD_STATES dataHold)
PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_SPI_ExistsReadDataSignStatus(SPI_MODULE_ID index)
SWITCH_STATES
Definition: inszt_app.c:27636
bool DRV_TMR0_Start(void)
PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_USART_BaudRateHighEnable(USART_MODULE_ID index)
static void qqoutput0(FILEPOINT char *s)
void qqpopulate_array_fcn_ptrQQ(int x, ldra_void_function y, ldra_void_function z)
Definition: inszt_main.c:157
void PLIB_USART_OperationModeSelect(USART_MODULE_ID index, USART_OPERATION_MODE operationmode)
SPI_AUDIO_TRANSMIT_MODE audioTransmitMode
Definition: inszt_adc.c:26559
void DRV_ADC1_Close(void)
static void Execute_Protocol_B(void)
void PLIB_SPI_AudioErrorDisable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
bool PLIB_USART_ExistsReceiverAddressDetect(USART_MODULE_ID index)
uintptr_t DRV_SPI_BUFFER_HANDLE
Definition: inszt_adc.c:26247
APP_DATA APP
Definition: app.c:73
TMR_PRESCALE DRV_TMR1_PrescalerGet(void)
bool PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus(SPI_MODULE_ID index)
void SYS_PORTS_Initialize()
void PLIB_SPI_AudioErrorEnable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
bool PLIB_SPI_Exists32bitBuffer(SPI_MODULE_ID index)
void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
SPI_AUDIO_PROTOCOL audioProtocolMode
Definition: inszt_adc.c:26561
SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void)
static SWITCH_STATES SW_STATES
DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus(DRV_HANDLE handle)
uint8_t numTrfsSmPolled
Definition: inszt_adc.c:26587
DRV_SPI_CLOCK_MODE clockMode
Definition: inszt_adc.c:26576
void PLIB_SPI_BufferWrite(SPI_MODULE_ID index, uint8_t data)
static int qqqlast
static void DRV_TMR4_DeInitialize(void)
void PLIB_PORTS_ChannelModeSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK modeMask, PORTS_PIN_MODE mode)
bool PLIB_USART_ExistsReceiverEnable(USART_MODULE_ID index)
bool PLIB_SPI_ExistsOutputDataPhase(SPI_MODULE_ID index)
static void process_switches(void)
void PLIB_PORTS_PinChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
bool PLIB_USART_ExistsModuleBusyStatus(USART_MODULE_ID index)
void PLIB_SPI_AudioProtocolDisable(SPI_MODULE_ID index)
uint32_t DRV_TMR_AlarmHasElapsed(DRV_HANDLE handle)
bool PLIB_DMA_LastBusAccessIsRead(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXChainEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
S4_COMMAND
Definition: inszt_app.c:27708
void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsFrameErrorStatus(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXPatternLength(DMA_MODULE_ID index)
static void qqqbitmapreset(qqnull_params)
struct _DRV_SPI_CLIENT_DATA DRV_SPI_CLIENT_DATA
bool PLIB_DMA_ExistsChannelXStartIRQ(DMA_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
uintptr_t SYS_DMA_CHANNEL_HANDLE
Definition: inszt_adc.c:13249
void PLIB_USART_ReceiverOverrunErrorClear(USART_MODULE_ID index)
bool PLIB_USART_ExistsBaudRateAutoDetect(USART_MODULE_ID index)
S3_COMMAND
void SYS_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
bool PLIB_PORTS_ExistsChangeNoticeEdgeStatus(PORTS_MODULE_ID index)
void PLIB_USART_ReceiverDisable(USART_MODULE_ID index)
Definition: app.h:59
void PLIB_DMA_Disable(DMA_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
DRV_HANDLE DRV_TMR_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT intent)
void PLIB_DMA_ChannelXAbortIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQ)
void PLIB_DMA_ChannelXReloadEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_IC0_Initialize(void)
void PLIB_USART_RunInSleepModeEnable(USART_MODULE_ID index)
void SYS_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
void SYS_PORTS_ChangeNotificationPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
bool PLIB_USART_ExistsReceiver(USART_MODULE_ID index)
bool PLIB_DMA_ExistsStartTransfer(DMA_MODULE_ID index)
void DRV_SPI_Tasks(SYS_MODULE_OBJ object)
DRV_USART_TRANSFER_STATUS
void PLIB_USART_RunInOverflowEnable(USART_MODULE_ID index)
void SWITCH_Tasks(void)
static void DRV_TMR3_DeInitialize(void)
void PLIB_USART_BRGClockSourceSelect(USART_MODULE_ID index, USART_BRG_CLOCK_SOURCE brgClockSource)
DRV_USART_BUFFER_RESULT
Definition: inszt_adc.c:15118
void PLIB_DMA_ChannelXAutoEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_FIFOShiftRegisterIsEmpty(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsCRCByteOrder(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsEnableControl(DMA_MODULE_ID index)
void PLIB_SPI_BaudRateClockSelect(SPI_MODULE_ID index, SPI_BAUD_RATE_CLOCK type)
void PLIB_SPI_ErrorInterruptEnable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
bool PLIB_DMA_ExistsCRCBitOrder(DMA_MODULE_ID index)
void DRV_TMR3_StopInIdleEnable(void)
INT_SOURCE rxInterruptSource
Definition: inszt_adc.c:26582
SYS_STATUS DRV_USART_Status(SYS_MODULE_OBJ object)
void DRV_TMR_Close(DRV_HANDLE handle)
SYS_STATUS SYS_DEBUG_Status(SYS_MODULE_OBJ object)
void DRV_TMR0_StopInIdleEnable(void)
uint32_t DRV_TMR4_CounterValueGet(void)
PORTS_PIN_INTERRUPT_TYPE
Definition: inszt_adc.c:21903
DRV_TMR_OPERATION_MODE
uint8_t count
Definition: inszt_man.c:29594
bool PLIB_SPI_ExistsBaudRate(SPI_MODULE_ID index)
uint8_t fire_switch_S1[2]
Definition: inszt_app.c:27665
bool PLIB_DMA_ExistsBusy(DMA_MODULE_ID index)
void PLIB_USART_StopInIdleEnable(USART_MODULE_ID index)
S5_COMMAND
void DRV_TMR1_Initialize(void)
bool PLIB_PORTS_ExistsPinModePerPort(PORTS_MODULE_ID index)
void PLIB_PORTS_PinDirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void * PLIB_SPI_BufferAddressGet(SPI_MODULE_ID index)
SYSTEM_OBJECTS sysObj
SYS_MODULE_OBJ DRV_SPI_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
static void DRV_TMR1_Close(void)
uint8_t hvps_switch_S5
Definition: inszt_app.c:27666
void DRV_USART_BufferAddRead(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *const bufferHandle, void *buffer, const size_t size)
S1_COMMAND S1_state
Definition: inszt_app.c:27777
void DRV_TMR4_CounterValueSet(uint32_t value)
static void qqoutput2(FILEPOINT char *s, int i, int j)
DRV_USART_CLIENT_STATUS DRV_USART0_ClientStatus(void)
void DRV_TMR1_StopInIdleEnable(void)
void DRV_ADC_Stop(void)
INT_SOURCE errInterruptSource
Definition: inszt_adc.c:26584
bool PLIB_DMA_CRCAppendModeIsEnabled(DMA_MODULE_ID index)
DRV_TMR_CLK_SOURCES
Definition: inszt_adc.c:1694
void PLIB_PORTS_CnPinsPullUpEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void(* DRV_TMR_CALLBACK)(uintptr_t context, uint32_t alarmCount)
void Set_Status(uint8_t bitposn)
bool PLIB_DMA_ExistsCRCAppendMode(DMA_MODULE_ID index)
ldra_void_function qqqaccumreset[QQQnumfil]
Definition: inszt_main.c:154
void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
bool PLIB_PORTS_ExistsChangeNoticePerPortStatus(PORTS_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXPatternData(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsPinControl(SPI_MODULE_ID index)
bool PLIB_DMA_ChannelXINTSourceIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
uint16_t PLIB_DMA_ChannelXPeripheralAddressGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXSourceSize(DMA_MODULE_ID index)
void PLIB_USART_ReceiverInterruptModeSelect(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE interruptMode)
SYS_DMA_CRC_WRITE_ORDER
static SYS_STATUS DRV_TMR4_Status(void)
int8_t PLIB_USART_ReceiverByteReceive(USART_MODULE_ID index)
void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
DRV_USART_INIT_FLAGS
void DRV_TMR2_PeriodValueSet(uint32_t value)
void PLIB_PORTS_PinChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
bool PLIB_DMA_ExistsChannelXPriority(DMA_MODULE_ID index)
static SYS_STATUS DRV_TMR3_Status(void)
DRV_HANDLE DRV_USART_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
void DRV_TMR3_Initialize(void)
void PLIB_SPI_ErrorInterruptDisable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
void PLIB_DMA_ChannelXINTSourceEnable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
bool PLIB_USART_ExistsBaudRate(USART_MODULE_ID index)
DRV_SPI_MODE spiMode
Definition: inszt_adc.c:26541
uint8_t PLIB_DMA_ChannelBitsGet(DMA_MODULE_ID index)
void PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet(DMA_MODULE_ID index)
DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_ADC_DeInitialize(void)
bool PLIB_SPI_ExistsFrameSyncPulseDirection(SPI_MODULE_ID index)
void PLIB_USART_LoopbackEnable(USART_MODULE_ID index)
SWITCH_COMMAND SW_COM
void DRV_TMR1_CounterClear(void)
bool PLIB_PORTS_ExistsChangeNoticePerPortTurnOn(PORTS_MODULE_ID index)
void DRV_USART_BufferEventHandlerSet(const DRV_HANDLE handle, const DRV_USART_BUFFER_EVENT_HANDLER eventHandler, const uintptr_t context)
void PLIB_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
uint32_t DRV_TMR0_CounterValueGet(void)
void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index, SPI_INPUT_SAMPLING_PHASE phase)
HVPS_DATA HV_PS
Definition: hvps.c:56
void SYS_DMA_Resume(void)
void PLIB_USART_BaudRateSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
void SYS_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
DRV_SPI_BUFFER_TYPE
void PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_DMA_ChannelXTriggerDisable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
void PLIB_DMA_CRCBitOrderSelect(DMA_MODULE_ID index, DMA_CRC_BIT_ORDER bitOrder)
bool PLIB_USART_WakeOnStartIsEnabled(USART_MODULE_ID index)
bool Valid_Command(uchar8_t msg)
Definition: commands.c:1111
uint32_t PORTS_DATA_TYPE
void(* DRV_SPI_BUFFER_EVENT_HANDLER)(DRV_SPI_BUFFER_EVENT event, DRV_SPI_BUFFER_HANDLE bufferHandle, void *context)
void PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
static struct bitmapstruct_t bitmapstruct
DRV_SPI_TASK_MODE taskMode
Definition: inszt_adc.c:26539
void PLIB_DMA_ChannelXStartIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQnum)
void PLIB_DMA_ChannelXChainToLower(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsClockPolarity(SPI_MODULE_ID index)
void DRV_TMR4_PeriodValueSet(uint32_t value)
DRV_USART_OPERATION_MODE
bool PLIB_USART_ReceiverIsIdle(USART_MODULE_ID index)
bool PLIB_DMA_ExistsCRCData(DMA_MODULE_ID index)
void DRV_TMR0_StopInIdleDisable(void)
static void qqbmsoutput(FILEPOINT char *s, unsigned int i)
uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
#define switches_57zqqzqz1
void SYS_DEBUG_Tasks(SYS_MODULE_OBJ object)
void PLIB_USART_BaudRateHighSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
uint32_t DRV_ADC_SamplesRead(uint8_t bufIndex)
void PLIB_DMA_ChannelXOperatingTransferModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRANSFER_MODE channeltransferMode)
bool PLIB_USART_ExistsReceiverParityErrorStatus(USART_MODULE_ID index)
void PLIB_SPI_FrameSyncPulseDirectionSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_DIRECTION direction)
bool PLIB_USART_ModuleIsBusy(USART_MODULE_ID index)
void PLIB_USART_ReceiverIdleStateLowDisable(USART_MODULE_ID index)
void DRV_TMR_CounterValueSet(DRV_HANDLE handle, uint32_t counterPeriod)
DRV_TMR_CLIENT_STATUS
uint16_t PLIB_DMA_ChannelXCellSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_DMA_CRCPolynomialLengthSet(DMA_MODULE_ID index, uint8_t polyLength)
bool PLIB_USART_ReceiverAddressIsReceived(USART_MODULE_ID index)
void PLIB_USART_ReceiverAddressDetectEnable(USART_MODULE_ID index)
void DRV_ADC0_Close(void)
void DRV_USART_TasksReceive(SYS_MODULE_OBJ object)
void PLIB_DMA_CRCWriteByteOrderAlter(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXPatternLengthSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_PATTERN_LENGTH patternLen)
void Prepare_Return_B(uint8_t byt [])
DRV_TMR_CLIENT_STATUS DRV_TMR3_ClientStatus(void)
SYS_ERROR_LEVEL gblErrLvl
static void qqoutput(FILEPOINT char *s, int i)
bool PLIB_SPI_ExistsFrameSyncPulseCounter(SPI_MODULE_ID index)
void PLIB_DMA_CRCChannelSelect(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_PinGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static void DRV_TMR4_Tasks(void)
uintptr_t DRV_USART_BUFFER_HANDLE
void Clear_Status(uint8_t bitposn)
bool DRV_TMR4_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
uintptr_t SYS_DMA_CHANNEL_HANDLE
uint32_t PLIB_DMA_RecentAddressAccessed(DMA_MODULE_ID index)
void PLIB_USART_ReceiverAddressDetectDisable(USART_MODULE_ID index)
void PLIB_USART_WakeOnStartEnable(USART_MODULE_ID index)
SPI_FRAME_SYNC_PULSE frameSyncPulse
Definition: inszt_adc.c:26549
static SYS_STATUS DRV_TMR2_Status(void)
bool PLIB_SPI_ExistsFrameSyncPulseWidth(SPI_MODULE_ID index)
PORTS_DATA_TYPE PLIB_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void SYS_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
float float32_t
SYS_STATUS DRV_TMR_Status(SYS_MODULE_OBJ object)
bool PLIB_SPI_FrameErrorStatusGet(SPI_MODULE_ID index)
SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
PORTS_DATA_TYPE SYS_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXChainEnbl(DMA_MODULE_ID index)
bool PLIB_PORTS_ChangeNoticePerPortHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet(USART_MODULE_ID index)
void * PLIB_USART_TransmitterAddressGet(USART_MODULE_ID index)
S4_COMMAND S4_state
Definition: inszt_app.c:27775
uint8_t DRV_PMP0_Read(void)
DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet(DRV_HANDLE handle, DRV_TMR_DIVIDER_RANGE *pDivRange)
SYS_DMA_TRANSFER_EVENT
Definition: inszt_adc.c:13469
bool PLIB_SPI_ExistsTransmitBufferEmptyStatus(SPI_MODULE_ID index)
void PLIB_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
uint8_t dump_fire_count
Definition: inszt_app.c:27673
bool PLIB_USART_ExistsReceiverIdleStatus(USART_MODULE_ID index)
void PLIB_DMA_ChannelXDestinationSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t destinationSize)
bool DRV_SPIn_TransmitterBufferIsFull(void)
void DRV_TMR4_StopInIdleEnable(void)
S5_COMMAND
Definition: inszt_app.c:27754
SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
uint32_t DRV_TMR3_CounterFrequencyGet(void)
void PLIB_DMA_ChannelXDestinationAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode)
void PLIB_DMA_ChannelXPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_PRIORITY channelPriority)
void DRV_USART0_WriteByte(const uint8_t byte)
bool PLIB_DMA_LastBusAccessIsWrite(DMA_MODULE_ID index)
void SET_WL_SPS_IOffset(uint8_t mode)
SWITCH_DATA SWITCH